Repository navigation
fix(widget-dev): share the folder id helper, say the inode reuse limit, and ask to choose a remade folder again - #660
Merged
Conversation
…t, and ask to choose a remade folder again Export devRootIdentityOf from core with a followLinks option and use it for the chosen-folder id in the runtime, so the lstat copy goes away with the same semantics. A session Clark started in a chosen folder that was made again stops as root-refused at the next restart; the status line and the session's row on the develop card now tell the person to choose the folder again, and the not-found note says that starting a new folder there chooses it. Document that ext4 can give a folder deleted and made again at once the old file id, and why birth time is no second signal. Refs #643
…-identity # Conflicts: # docs/manifest.json
Contributor
Author
|
Review attestation: ready to merge at A push to this PR makes this attestation stale; the new head needs its own review. |
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.
The follow-ups to chosen-folder identity from the review of #641 (#628). Refs #643; official docs in digitopvn/clarkcant-web#143 (not merged), so this PR alone does not close the issue.
What changes, item by item
birthtimeNswas equal toctimeNs, and two folders made within one clock tick had the same inode and the same birth time to the nanosecond.statxis not available, and the change time moves with every file added or removed.So birth time cannot tell a remade folder apart, and as a fallback it would break the common case. The limit is now stated in
docs/open-interfaces(.vi).md,docs/widget-development(.vi).md, the core helper's comment and the official docs. They also say that a watched folder is held open on Linux and macOS (pinRoot), so the reuse cannot happen while a session watches the folder, and they advise forgetting a folder before deleting it.root-refusedat the next restart. The status line copy (shell.dev.stopReason.root-refused, EN+VI) now says why and to choose the folder again with/develop. The session's row on thedevelopcard now notes that Develop again chooses it. Documented in open-interfaces (EN+VI), widget-development (EN+VI) and thewidgetDevStopReasonSchemacomment.devRootIdentityOf(root, { followLinks? })is exported from@clarkcant/core:statby default, as the engine uses it, andlstatwithfollowLinks: false. The runtime'sfolderIdOfnow only converts its result to the store's string form, so thelstatcopy is gone. The runtime keepslstatsemantics: a link at the path gives no id.packages/core/test/dev-root-identity.spec.tscovers both modes: a folder, a file, a missing path, a link at the path, and a link above the path.chosenFolderId, and the person re-starting a live session after its folder was made again records the new folder's id.Verification
origin/mainsources (7 failures: 4 core helper tests, the not-found note test, the restart card test, and the status line test). They pass on the branch.chosenFolderIdfromforgetand from the live re-start: both tests then fail.pnpm typecheck,pnpm invariants(the manifest was refreshed with--fix-manifest) and eslint on the changed files are clean.pnpm verify: exit 0 (579 files passed, 1 skipped; 7937 tests passed).Overlap
#656's flake fixes touch
packages/core/test/widget-dev-engine.spec.tsand the "keeps the newest build's snapshot" test inapps/runtime/test/widget-dev-sessions.spec.ts. This PR does not edit the engine spec: the helper tests are in a new file. The runtime spec edits sit in the chosen-folder group (around lines 735-880), away from that test.