8000 fix(notes): stop autosave from raising revision conflicts while typing by ahmet-cetinkaya · Pull Request #313 · ahmet-cetinkaya/whph · GitHub
[go: up one dir, main page]

Skip to content

fix(notes): stop autosave from raising revision conflicts while typing - #313

Merged
ahmet-cetinkaya merged 1 commit into
mainfrom
fix/note-autosave-revision-conflict
Sep 27, 2026
Merged

ahmet-cetinkaya merged 1 commit into
mainfrom
fix/note-autosave-revision-conflict

Conversation

@ahmet-cetinkaya
Copy link
Copy Markdown
Owner

Problem

A user report (v0.24.0, Android) shows NoteRevisionConflictException: The note was changed by another operation. while editing a note. Since v0.24.0 (0f46c172), the note editor sends an UpdateNoteCommand with an expected revision. The revision comes from the cached note, and the reload after a save is skipped while the title or content field has focus. So the second debounced save while typing sends a stale revision, and the conditional update rejects it.

Fix

NoteDetailsContent now tracks the latest revision itself, taking it from each save response and from reloads. Saves also run one after another, so each save uses the revision produced by the previous one.

Tests

  • New widget test note_details_content_test.dart sends two consecutive autosaves with the field focused, against a mediator that enforces the revision check. It fails before the fix (1 conflict) and passes after it.
  • dart analyze and format are clean on the changed files.
  • Full flutter test: the only failures are pre-existing ones that also fail on main (desktop_server_sync_service_test.dart, desktop_sync_service_test.dart, integration/mcp_user_actions_test.dart).

The note editor built each save from the cached note's revision, but the
post-save reload is skipped while a field has focus, so the second
debounced save sent a stale revision and failed with
NoteRevisionConflictException. Track the latest revision from save
responses and serialize saves so each uses the previous result.
@ahmet-cetinkaya
ahmet-cetinkaya merged commit 63621c8 into main Sep 27, 2026
4 checks passed
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

0