Repository navigation
A fast key queued just before the overview deadline waits out its own settle window - #1464
Closed
Aschenbath wants to merge 1 commit into
Closed
Aschenbath wants to merge 1 commit into
Aschenbath wants to merge 1 commit into
Conversation
… 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>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1463.
What this does
When the overview's 3 s deadline fired, it called
push(key)and thenflush()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. OnlyflushAll, 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.useKbEventscalls 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
79b34901ondev1d94b532:pnpm exec vitest run: 49 files, 342 tests passed. Four of them are new, in "the overview deadline and the fast keys". With the oldpush(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