ChangeNotes: Don't auto-rebuild if both state and ref are missing
This is the normal state when only writing NoteDb changes but not reading. The whole point of the optimization in Ic8c6c28e was to keep old changes in this state until an explicit rebuild. Change-Id: I9353bcd36ead4f4f7350884c795b0bad9c0da572
This commit is contained in:
@@ -153,8 +153,8 @@ public class DraftCommentNotes extends AbstractChangeNotes<DraftCommentNotes> {
|
||||
NoteDbChangeState state = NoteDbChangeState.parse(change);
|
||||
// Only check if this particular user's drafts are up to date, to avoid
|
||||
// reading unnecessary refs.
|
||||
if (state == null
|
||||
|| !state.areDraftsUpToDate(new RepoRefCache(repo), author)) {
|
||||
if (!NoteDbChangeState.areDraftsUpToDate(
|
||||
state, new RepoRefCache(repo), getChangeId(), author)) {
|
||||
return rebuildAndOpen(repo);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user