Repository navigation
test(file-explorer): count the linked-folder check in the rename scan bound - #25816
Closed
brennanb2025 wants to merge 1 commit into
Closed
brennanb2025 wants to merge 1 commit into
brennanb2025 wants to merge 1 commit into
Conversation
… bound #25371 made the watcher reconciler build the cache path index once per payload to learn whether any cached folder is a link, because nodes carry no link target and watcher events name targets. The rename-batch test still asserted a single cache scan, so it failed on main (4002 vs 2001). The bound stays exact: one purge scan plus one link check. Co-Authored-By: Claude <[email protected]>
8 of 9 tasks
Contributor
Author
|
Superseded by #24878, which fixed this on main (it reuses one cache-key enumeration for the link check and the purge, keeping the strict one-scan bound). |
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.
ELI5
Main's unit-test shard "test / tests node 24 2/5" is red for every PR.
file-explorer-watch-reconcile.test.ts› "purges distinct cached directory renames with one bounded cache scan" fails withexpected 4002 to be 2001.The cause is #25371. Running only that test file, it passes at #25371's parent (c8ff7e8) and fails at #25371 (fff8718).
#25371 taught the file explorer to refresh linked folders when their targets change. To do that, the code that applies file-watcher events now looks through the explorer's folder cache once per batch of events, to see whether any cached folder is a link. The test still allowed only the single pass it did before, for clearing out renamed folders.
This PR updates the test to count that second pass. It does not change product code.
What Changed
What changes for users: nothing. This is test-only, and it makes main's unit tests green again.
The test is renamed to "purges distinct cached directory renames with one purge scan and one link check". Its bound goes from one pass over the cache keys to exactly two (
toBe(entryCount * 2)). It stays an exact equality, so any further pass still fails it. A comment names #25371 and says why the second pass exists.Why
I checked whether the second pass could be removed instead, and it can't without storing new state:
Cost: one pass over the cached folder paths and their children, once per batch of watcher events that isn't a plain edit to a known file. Plain file edits still skip it.
Follow-up (not filed): keep an index of cached linked folders beside the cache, updated when folders load, so no pass is needed. That is #25371's owner's area and stores derived state, so it's left out of this test-only fix.
Linked Issue
None. This is a red test on main from #25371.
Visual Proof
N/A: test-only change, nothing visible to users.
Testing
Bisect: running only this test file, it passes at fff8718^ and fails at fff8718 (
expected 4002 to be 2001).With this change, I ran 78 test files explicitly: every
file-explorer-*anduseFileExplorer*test inright-sidebar/, plus every test file #25371 touched. 77 passed.local-file-access.test.tstimed out in that batch at load average 115–133; run alone, it passes 17/17.tc-gate pnpm tc:web,oxlintandpnpm run check:code-quality:changedpass.Platforms: macOS locally; CI covers Linux and Windows.
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
No product code, SSH, mobile or platform behaviour changes.
PR author: @BrennanKB5.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)