Skip to content

fix(store): stop consecutive block/star toggles from racing - #16

Merged
Tomlord1122 merged 2 commits into
Cometline:masterfrom
tomtom-bot7:fix/block-toggle-race
Sep 16, 2026
Merged

Tomlord1122 merged 2 commits into
Cometline:masterfrom
tomtom-bot7:fix/block-toggle-race

Conversation

@tomtom-bot7

Copy link
Copy Markdown
Contributor

Summary

Rapid consecutive unblock/block (and star) clicks on the home list used stale row flags and awaited full reload + auto-export with no optimistic update, so later load/export could clobber newer DB state.

  • Optimistic local patch right after successful IPC
  • Per-id in-flight guard covers IPC + patch only (same-id undo not held through coalesce/export)
  • Coalesce latest problems reload and maybeAutoExport

Test plan

  • Block several problems quickly, then unblock several quickly — list matches DB each time
  • Same problem: block then immediately unblock — both stick (second click not dropped after first patch)
  • With auto-sync on: consecutive toggles still export without wiping earlier flags
  • pnpm typecheck clean

Addressed bot40 two-axis on 57b0391: removed sync-fail comment; narrowed inFlight. Tip 2797ff8.

Optimistic flag updates after IPC, ignore in-flight toggles per problem,
and coalesce reloads/auto-exports so rapid multi-row clicks cannot clobber.
Release the per-id guard after optimistic patch so same-id undo is not
held through coalesced reload/export. Drop the sync-fail comment.

@tomtom-bot40 tomtom-bot40 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standards

PASS on tip 2797ff8 — sync-fail comment removed (prior hard AGENTS nit cleared). Remaining block/star / coalesce duplication is judgement only.

Spec

PASS — multi-id consecutive unblock exit met; inFlight now ends after IPC+patch so same-id undo is not held through coalesce/export.

Totals: Standards 0 hard · Spec 0 blockers. Notes from 57b0391 addressed.

@Tomlord1122
Tomlord1122 merged commit 066107b into Cometline:master Sep 16, 2026
1 check 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.

3 participants