Repository navigation
B-Extra: live file lists through the root room - #445
Merged
Merged
Conversation
…ged (#426) - Worker: the access checks note the roots a request may change; after a write that went through, each root's room (the CanvasRoom class named root:<project> or root:home:<user>) says "changed". Lock takes and renewals do not count. GET /api/live/root opens a watcher's socket. - Studio: every root on screen keeps a socket and reads itself again on "changed" (once for a burst) and after a reconnect; a photo uploaded from a phone shows without a reload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Part of #426 (B-Extra), round 3, step 5: live file lists (R14).
How it works
checkAccessfor files;assertAccess/assertReffor projects;rootFromfor the home) note the roots the request may change. Notes are taken only at editor rank and above, so reads note nothing.changed. Taking or renewing an edit lock does not count.CanvasRoomDurable Object class under the nameroot:<project id>orroot:home:<user id>. No new class, so the deploy changes nothing.GET /api/live/root?project_id=or?home=1opens a viewer's socket (viewer access is enough).changedit reads the root again (once for a burst of changes, 250 ms) and again after a reconnect. A photo uploaded from the phone, or a change made in another browser, shows without a reload, so no Reload button is needed.Cost
One Durable Object request per write per root, plus one idle socket per open root per browser (hibernating).
Checked
make checkgreen, with a new route test: another workspace cannot watch, and a watcher hears a folder made and binned. Tenancy has an entry for the route.🤖 Generated with Claude Code