You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hub join: a device whose token was revoked cannot pair again #99
A device whose token the hub revoked cannot pair again with notesctl hub join, and no command removes the device's old hub record. The only way out today is to move the device's data directory aside.
Found by Duncan in the Snow retest of #98 on 2026-10-26 (finding F3). This is older than #98; #98 does not change it.
Evidence
In the retest VM, the hub's devices 1 and 2 were revoked (hub revoke). On the device, notesctl hub join <url> <vault> then failed with the hub refused this device's token: pair again (errRevoked, internal/syncer/syncer.go).
sync leave did not help. To continue, Duncan moved the device data to data/frostnotes.before-retest; a fresh notesd then paired.
Cause: pairHub in cmd/notesctl/hub.go returns at once when sync.hubs already lists a hub with the same URL, so join never calls sync.pair. It goes straight to sync.join, which dials with the revoked token (or with no token, if the secret is gone).
The sync protocol says "A 401 on any request marks every vault synced with that hub revoked, and sync with it stops until the device pairs again" (docs/specs/sync-protocol.md, URLs and tokens). The device has no supported way to pair again.
Possible fixes (to decide)
pairHub reuses a hub only when its token still works: when the hub's state is revoked, or the device holds no token for it, join pairs again. sync.paired already replaces the row (PutSyncHub) and the token.
Or a command that forgets a hub on the device (for example notesctl hub forget URL, a new sync method), after its vaults left it.
Also small: after a successful hub join, the output was syncing at : offline, with the hub vault and URL empty (F4, cosmetic).
Done when
A device whose token was revoked can run notesctl hub join again and sync, without moving its data directory, and a test covers it.
Activity