Skip to content

Commit 04de8e3

Browse files
davidhooclaude
andcommitted
fix: always set annDirty in MarkDirty to avoid startup dedup conflict
The MarkDirty dedup (skip when Dirty && CursorTargetID==0) was too aggressive — it prevented annDirty from being set when the constructor already marked Dirty=true on startup. Now the dedup only skips log spam and redundant state saves; annDirty is always set. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent a70b74c commit 04de8e3

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

backend/internal/service/person_merge_suggestion_service.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,15 +302,18 @@ func (s *personMergeSuggestionService) MarkDirty(reason string) error {
302302
s.mu.Lock()
303303
defer s.mu.Unlock()
304304

305-
if s.state.Dirty && s.state.CursorTargetID == 0 {
306-
return nil
307-
}
305+
alreadyDirty := s.state.Dirty && s.state.CursorTargetID == 0
308306

309307
s.state.Dirty = true
310308
s.state.CursorTargetID = 0
311309
s.annMu.Lock()
312310
s.annDirty = true
313311
s.annMu.Unlock()
312+
313+
if alreadyDirty {
314+
return nil // already pending — skip log spam and redundant state save
315+
}
316+
314317
if reason != "" {
315318
s.appendBackgroundLogLocked("合并建议待更新: " + reason)
316319
}

0 commit comments

Comments
 (0)