Skip to content

Don't re-enroll an already hosted drive when opening the sync page - #2200

Closed
joepio wants to merge 1 commit into
developfrom
claude/project-thread-0tg9j1
Closed

joepio wants to merge 1 commit into
developfrom
claude/project-thread-0tg9j1

Conversation

@joepio

@joepio joepio commented Oct 10, 2026

Copy link
Copy Markdown
Member

Requested by Joep · project thread

Before: Opening the sync page on a drive already hosted on Cloud Server showed a "Working offline" toast and then "Connected to Cloud Server. Syncing this workspace…" every time.

After: Neither toast appears for a drive that is already on a managed node. A drive that really needs enrolling still auto-enrolls, with the same success toast, and real disconnects still show the offline toast.

The sync page auto-enrolled any account-enrolled drive until the node's proof of hosting arrived, so it re-ran enrollment, and the socket reconnect in enableCloudSyncForDrive looked like a disconnect to NetworkIndicator.

How: new shouldAutoEnroll helper (driveSyncStatus.ts) waits until /server has answered for the current server and skips servers that are already managed; SyncRoute.tsx tracks which server that info came from. NetworkIndicator now reads the ws-disconnected flag per event instead of once at mount. Unit tests for the helper added (2 of 4 new cases fail without the fix). I could not make the toasts show in a browser even with a mocked managed setup, but the unwanted /api/sync-enrollments/challenge request reproduced before the fix and is gone after. Screenshots of the sync page follow in a comment.


Generated by Claude Code

The sync page auto-enrolled any drive the account had enrolled until the
node-side proof of hosting (live sync + drive usage) arrived. On a drive
already on Cloud Server that re-ran enrollment, reconnected the socket
(a spurious 'Working offline' toast) and announced 'Connected to Cloud
Server'. Skip it when the current server is already a managed node, and
read the user-disconnected flag per event in NetworkIndicator.
@joepio joepio self-assigned this Oct 10, 2026
@joepio
joepio marked this pull request as ready for review October 10, 2026 14:19

joepio commented Oct 10, 2026

Copy link
Copy Markdown
Member Author

E2E shard 3 of run 38060558450 is red on one test: tests/forms.spec.ts "page transitions animate once switched on" (fails on all three attempts, expects the atomic-form-page-exit-up and atomic-form-stagger-in animations and sees none). Nothing in this PR touches forms or animations; it only changes the sync page's auto-enroll condition and NetworkIndicator, and no other shard failed. The failure-state.spec.ts entries in the artifact are the specs' own deliberate synthetic failures. I'm treating the forms test as not this PR's and re-running the failed jobs once; if it fails again I'll look at it as this PR's problem.


Generated by Claude Code

joepio commented Oct 11, 2026

Copy link
Copy Markdown
Member Author

Landed in develop through the batch #2210 (squash f39e460), tested together on Mancave run 5204.


Generated by Claude Code

@joepio joepio closed this Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant