Skip to content

Failed thread-notes saves discard the edited text when the editor is reopened #935

Closed

Description

@currentbits

Priority: P1. Reproduced at commit 6c7a6fbe on 2026-09-05.

Closing thread notes discards the user's edit when persistence fails. The app shows an error, but reopening the editor restores only the old saved note.

Reproduction

  1. Open a thread with notes="Original saved note" in the real App.
  2. Make api.threads.setNotes reject with "Notes save rejected".
  3. Open Thread notes and type "Important unsaved investigation notes".
  4. Click the notes button again to save/close.
  5. The editor closes and the error appears.
  6. Reopen notes: the textarea contains "Original saved note"; the edited text is gone. The host still has only the original.

Confirmed through actual App, ThreadView and useCoder with a rejecting fakeCoder method.

Cause

ThreadView.closeNotes clears the editing state and calls onSetNotes without awaiting success. App.handleSetNotes drops the returned promise; useCoder.setNotes catches the error without returning failure. toggleNotes always initializes the draft from thread.notes, overwriting the failed edit. The outgoing-thread autosave path also uses fire-and-forget delivery.

Acceptance

  • Preserve failed note edits and provide a retry.
  • Close/discard only on confirmed save or explicit cancellation.
  • Keep any failed draft associated with its source thread across navigation.
  • Test actual App save rejection, reopen and retry; retain the existing successful blur and thread-switch behavior.

Related #194 introduced scratch notes. Separate from #921 composer drafts and #926 queued-prompt edits, which use different state and persistence paths.
Sources: closeNotes, App callback, setNotes.

Runnable audit evidence

Local artifact: docs/issue-drafts/2026-09-05-actions-reproduce.mjs.

node --import=./test/support/disable-grok-mcp.mjs --import=./test/support/render.mjs --experimental-strip-types docs/issue-drafts/2026-09-05-actions-reproduce.mjs

Exited 0 with three CONFIRMED assertions against actual app modules. The assertions demonstrate existing defects, not implemented fixes. Artifact currently exists in the audit checkout; the reproduction above stands alone.

Requested disposition: separate Planboard issue, plan:todo.

Activity

  1. added
    plan:todo
    plan:doing
    plan:done
    and removed
    plan:todo
    plan:doing
    on Sep 5, 2026
  2. currentbits commented on Sep 9, 2026

    @currentbits
    OwnerAuthor

    Failed notes persists now keep the typed draft and expose Retry. closeNotes/thread-switch only discard on confirmed save or Escape; failed drafts stay keyed to the source thread across navigation. App-level tests cover reject/reopen/retry plus the existing blur and thread-switch paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    plan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions