Skip to content

A fast key queued just before the overview deadline waits out its own settle window - #1464

Closed
Aschenbath wants to merge 1 commit into
deeplethe:devfrom
Aschenbath:fix/overview-deadline-1463
Closed

Aschenbath wants to merge 1 commit into
deeplethe:devfrom
Aschenbath:fix/overview-deadline-1463

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Closes #1463.

What this does

When the overview's 3 s deadline fired, it called push(key) and then flush() on the fast layer. That also invalidated any fast key queued in the last 300 ms, before that key had finished its own settle window. Now the overview deadline invalidates only the overview. Only flushAll, used on reconnect and teardown, still sends the overview through the fast layer. That way a reconnect's broader ["graph", kbId] covers it and the overview isn't fetched twice, which is what the old comment was protecting.

The two layers moved out of the hook into an exported createKbInvalidations(invalidate, kbId), so they can be tested without React. useKbEvents calls it, and its behaviour is otherwise unchanged.

Not changed: #1462

#1462 asks for a true debounce. #1311 deliberately refreshes the overview every few seconds while a source pushes. A debounce that resets on every event would freeze the overview for the whole push. I left that issue alone so a maintainer can decide it.

How it was checked

On Windows 11 with Node and pnpm, commit 79b34901 on dev 1d94b532:

  • pnpm exec vitest run: 49 files, 342 tests passed. Four of them are new, in "the overview deadline and the fast keys". With the old push(key); flush(); restored, the first new test fails, and it passes with this change.
  • pnpm exec tsc -b: passed. pnpm build: passed (existing chunk-size advisory only).

🤖 Generated with Claude Code

… out its own settle window instead of being flushed early with the overview.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Aschenbath <Aschenbath@users.noreply.github.com>
@WaylandYang

Copy link
Copy Markdown
Contributor

Thanks for this, and sorry for the overlap. I missed your PR and fixed #1463 in #1465, which is now on dev, so I'm closing this one. Your read of the bug and of #1462 was right.

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.

2 participants