fix(gatorwalk-factory): the studio watches a replaced directory again, and the page resyncs after a reconnect (swamp-club #2841) #425
Loading…
Reference in a new issue
No description provided.
Delete branch "cue/2841-gatorwalk-factory-studio"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes swamp-club #2841: studio file-watch and page edge cases left over from #2806's reviews.
#2884 rewrote the watch after this issue was filed. So, after triage, items 3, 4 and 6 no longer apply (the scenarios dir, the path refusal and refollow are gone), and item 5 is won't-fix. This PR fixes the two items that remain.
A replaced definition directory silences its watch (item 1).
studio_watch.tsnow keeps one watch per directory, along with the directory's inode.definitionevent goes out, after the new watches open, for the factories in a replaced directory and for any factory whose file newly resolves.close()that throws no longer blocks later refreshes.The page does not resync after its event stream reconnects (item 2).
listen()remembers an error, and the nextopenrunsreloadFactories()and thenloadDefinitionFile(). A failure shows as a source error.Tests:
integration/engine/studio_watch_test.ts(a real temp dir; the unit tests have no--allow-write) covers an edit, a delete and recreate, and a file missing at one relist and back at the next. It failed before the fix.state_test.tscase with a stubbed EventSource. It fails without the fix.Also: the page bundle is rebuilt, and DESIGN.md's Live reload paragraph is updated.
Follow-up: swamp-club #2913. On ext4/XFS a recreated directory can reuse the inode number, which this check misses; the suggested fix is to also treat the watched directory's own remove event as a replacement.
Verified at
d47af95d9(verify-build 2de09478, verify-reviews 277ef76e): all checks passed, and both reviews passed.🤖 Generated with Claude Code