Skip to content

Sign in the server's time after a clock-ahead refusal - #1935

Closed
joepio wants to merge 2 commits into
developfrom
claude/project-thread-u8vgm0-clock-skew
Closed

joepio wants to merge 2 commits into
developfrom
claude/project-thread-u8vgm0-clock-skew

Conversation

@joepio

@joepio joepio commented Sep 30, 2026

Copy link
Copy Markdown
Member

What

Before: a device whose clock ran more than 10 seconds ahead of the server had every authentication and every commit refused ("Commit CreatedAt timestamp must lie in the past. Check your clock."). Nothing it did could sync, and retrying never helped because each new signature was just as far ahead. Seen on app.atomic.place with a desktop 10.7 s ahead of node1.

After: the first such refusal teaches the client the server's time, the WebSocket authenticates once more with a corrected timestamp, and later commits (including the outbox's retries) are signed in server time.

How

getTimestampNow adds an offset learned by learnServerClock, which reads the "Timestamp now: … CreatedAt is: …" refusal from WebSocket ERROR frames and HTTP commit responses. Offsets over a day are ignored. The connect path retries authentication once when the failure was that refusal. Unit test uses the exact refusal from production. Lib tests (1082) and lint pass. Not tried against a server with a skewed clock.


Generated by Claude Code

joepio added a commit that referenced this pull request Oct 1, 2026
…nt, Google sign-in (#1946)

Lands #1935 (server clock skew), #1936 (vault restore over 64 objects), #1944 (connect dialog), #1945 (twin agent resource) and #1856 (sign in to open the identity, pairs with atomic-saas #164), tested together on Mancave.

joepio commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Landed on develop through the batch #1946 (squash f2a07aa), tested together on Mancave. Closing this PR since its commits are in that batch.


Generated by Claude Code

@joepio joepio closed this Oct 1, 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