Skip to content

fix(notifications): stop a late mark-all-read result from panicking - #12

Open
laksamanakeris wants to merge 1 commit into
mainfrom
fix/write-back-after-unmount
Open

laksamanakeris wants to merge 1 commit into
mainfrom
fix/write-back-after-unmount

Conversation

@laksamanakeris

Copy link
Copy Markdown
Collaborator

What

  • Mark-all-read writes its error back with try_write. Before, a result that arrived after the popover closed panicked on the dropped signal.
  • A new test runs the write against a mock that waits before answering, and closes the popover mid-write. It fails on the old code with ValueDroppedError.
  • A new source scan bans use_action in views, components and modals.

Why

  • The mock normally answers immediately, so no existing test could reach this.
  • use_action cancels its running task on every new call. For a write, a repeated Save can drop a write that already committed and send it again.

Checks

  • cargo fmt, cargo clippy -D warnings, cargo nextest: 269 passed.
  • The scan fails on an injected use_action reference and names the file and line.

use_action runs its future on a scope-bound task and cancels the running
one on every new call. For a seam write, a second Save can drop a write
that already reached the server and then send it again. The existing
scan for scope-bound spawn cannot see it, because the spawn is inside
the hook. Writes use spawn_forever and report into root-scope state.
@laksamanakeris
laksamanakeris force-pushed the fix/write-back-after-unmount branch from d4c0d4d to 84fc731 Compare November 4, 2026 10:52
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