chore(model): log sequence anomaly when update appears not to "take" (#9741)

I hope this doesn't fire, but 👻  I'm Seeing Things I Can't Explain 👻
This commit is contained in:
Jakob Borg 2024-09-29 17:04:06 +02:00 committed by GitHub
parent 429672e0b4
commit 39df3173d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -435,8 +435,19 @@ func (s *indexHandler) receive(fs []protocol.FileInfo, update bool, op string, p
}
fset.Update(deviceID, fs)
seq := fset.Sequence(deviceID)
// Check that the sequence we get back is what we put in...
if lastSequence > 0 && seq != lastSequence {
s.logSequenceAnomaly("unexpected sequence after update", map[string]any{
"prevSeq": prevSequence,
"lastSeq": lastSequence,
"batch": len(fs),
"seenSeq": fs[len(fs)-1].Sequence,
"returnedSeq": seq,
})
}
s.evLogger.Log(events.RemoteIndexUpdated, map[string]interface{}{
"device": deviceID.String(),
"folder": s.folder,