Repository navigation
Conversation
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.
What does this PR do?
Closes #268
Closes #271
Closes #259
Refs #258
Four fixes in the client file system of a project (
packages/project,ProjectFsandClientProject):fs.statper changed path, one after the other. Up to 16 stats now run at once (CONCURRENT_STATS), and their answers are still applied in the batch's order, so the late or out-of-order event rules are unchanged.Promise.allover every path). At most 32 run at once now (CONCURRENT_LOOKUPS), and the results keep their order.FileTree(aMapthat also keeps the paths of each folder), sochildren(path)reads only that folder instead of scanning every entry for each folder.NOT_FOUND, the file stream'sonErrorreadsrecent, opens the project and subscribes again (ProjectFs.reattach). The reopen only goes on when the recent entry has the same id and trust. It gives up and fires a newClientProject.onDidLoseon a definite answer (no recent entry, another id or trust,NOT_FOUND/FORBIDDEN/UNAUTHORIZED, or a project lost again within 30 s). Any other failure tries again on the next loss.Why #258 stays open: the runtime panels' streams are not resubscribed after a reopen, nothing listens to
onDidLoseyet (the tab stays as it was), and a server copy opened for a reopen that gave up stays open until the sweep, because the projects contract has no close.AGENTS.mddocuments this under "Server streams and the idle sweep".How do you test this PR?
New tests in
packages/project/test:fs/project-fs-races.spec.ts: a large change batch is checked 16 stats at a time and told in its order; a file a batch made in a folder the same batch saw deleted is kept; at most 32 cached files are looked up at once, in order; the children of a folder match a scan of the whole tree.fs/project-fs.spec.ts: the project opens again after the idle sweep closed it while the tab was away.service/client-project.spec.ts(new, 9 tests against a fake RPC): reopens and follows again; gives up on another trust, with no recent entry, when the open fails; opens nothing once disposed; a project lost again and again opens only once; tries again when the open may pass; gives up within 30 s of a reopen, not after; ignores a refusal of a request sent before the reopen.Red before green, from the producer reports:
client-project.spec.tstests fail (onDidLosedid not exist); at a413bd7 the dispose test fails (expected "vi.fn()" to not be called at all, but actually been called 1 times);No red run or timing is recorded for the #268, #271 and #259 tests (the first producer report was not kept).
CHROME=… pnpm test:unitinpackages/project(Node, Chromium, Firefox), on af9bf77pnpm lint,pnpm typecheck, on af9bf77pnpm build(round 1, a7cea11)plugins/file-manager(25 tests),packages/code(48 tests),packages/sdk(3 tests, snapshot unchanged), round 1Integration: a scratch branch with every editor branch of this sweep merged passed
pnpm build, lint, typecheck,pnpm test --force(1014 passed, 1 skipped) and the full e2e suite with the engine (141/141, Chromium only).Merge danger
packages/project;ProjectFs.onDidLose,ProjectFs.reattachandClientProject.onDidLoseare tagged@internal. No protocol or server change. Merging tomaindeploys the editor app.AGENTS.md: fix/server-core-fs-safety and fix/tooling-scripts also add text there (fix/tooling-scripts edits the same "after changing a plugin manifest" area). Keep both texts when resolving.Follow-up issues
Quality gate
AGENTS.md, fff4528, reworded in af9bf77)Last round 82ea0d6, 6572993, af9bf77: producer red→green and the coordinator read the 82ea0d6 diff, not re-reviewed.