Skip to content

Do not crash on duplicate entry IDs - #2

Merged
r3dbars merged 1 commit into
mainfrom
fix/review-duplicate-entry-id
Aug 26, 2026
Merged

Do not crash on duplicate entry IDs#2
r3dbars merged 1 commit into
mainfrom
fix/review-duplicate-entry-id

Conversation

@r3dbars

@r3dbars r3dbars commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • visibleEntries now last-wins on duplicate IDs instead of trapping in Dictionary(uniqueKeysWithValues:).
  • Autosave writes the current todayEntry at fire time, and saveTodayNow() cancels the pending debounce so a stale snapshot cannot overwrite newer text.

Test plan

  • swift test --filter EntryStoreTests
  • Open two markdown files that share an id and confirm the editor still launches

Made with Cursor

Dictionary(uniqueKeysWithValues:) traps when two markdown files share an id, and the debounce used to write a stale snapshot captured at schedule time.

Co-authored-by: Cursor <cursoragent@cursor.com>
@r3dbars
r3dbars merged commit 57710d0 into main Aug 26, 2026
1 check passed
@r3dbars
r3dbars deleted the fix/review-duplicate-entry-id branch August 26, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant