Skip to content

fix(web): keep pending actions bound to their original view - #824

Merged
nixuuu merged 1 commit into
devfrom
fix/web-view-lifetimes
Nov 15, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/web-view-lifetimes

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 15, 2026

Copy link
Copy Markdown
Member

Change

Navigating away while a draft, history request, or queue gesture was pending could resume callbacks against another conversation or destroyed Svelte derived values.

  • Capture the bot, draft, and pending-message baseline before draft synchronization. Sending from bot A still delivers and acknowledges A's draft after navigation to B; completion cannot alter B's pending messages or sending indicator.
  • Dispose queue pointer listeners when the panel unmounts or its queue changes. Pointer cancellation restores the preview without saving, and deferred positioning cannot revive a finished gesture.
  • Bind quote navigation to the original thread lifetime and check it after history and render waits. Navigation cancels the jump silently instead of expanding/scrolling the next thread or showing a stale missing-source toast.

Document the lifecycle rules for retained callbacks and asynchronous work. These fixes address confirmed navigation races; they do not establish the cause of every reported derived_inert warning.

Fixes: #449
Fixes: #302

Verification

  • Web typecheck: bun run --cwd apps/web typecheck — zero errors and warnings.
  • Scoped oxlint, oxfmt, and git diff --check passed.
  • Temporary reproductions using the production code and Svelte runtime confirmed the failures before the fixes and zero derived_inert warnings afterward. Covered bot delivery/retry across navigation, queue disposal/cancellation, and quote cancellation during history loading and feed reveal, including genuine missing-source results.
  • Chromium with mocked backend responses: queue drop, cancellation, unmount, and replacement passed at desktop and phone widths in light and dark themes. Normal drop writes once; the cancellation cases write nothing. Timeline scrolling and fold expansion also produced no derived_inert warnings in the exercised fixture.
  • No UI copy changes. Reproduction scripts, screenshots, and logs remain outside the repository. Full repository checks and builds are left to CI; packaged desktop and a live gateway were not exercised for these fixes.

Capture the bot and draft before synchronization so navigation cannot
redirect an in-flight message or update the next conversation's state.
Dispose queue pointer listeners when the panel or queue changes, cancel
without committing, and ignore deferred positioning after disposal.
Cancel quote navigation after history/render awaits before reading a
replacement or destroyed view, without showing a missing-source toast.

Fixes: #449
Fixes: #302
@nixuuu
nixuuu enabled auto-merge (squash) November 15, 2026 11:48
@nixuuu
nixuuu merged commit 66f2ce4 into dev Nov 15, 2026
11 checks passed
@nixuuu
nixuuu deleted the fix/web-view-lifetimes branch November 15, 2026 12:01
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