Skip to content

Ensure auth before embedding userId in requests (#30, #31) - #33

Merged
rwestergren merged 1 commit into
mainfrom
fix-cold-start-add-serving-auth
Aug 2, 2026
Merged

Ensure auth before embedding userId in requests (#30, #31)#33
rwestergren merged 1 commit into
mainfrom
fix-cold-start-add-serving-auth

Conversation

@rwestergren

Copy link
Copy Markdown
Owner

add_serving() read self._user_id while building its payload, but on a cold client _ensure_auth() hadn't run yet, so it froze userId=null and Cronometer rejected the write. The retry re-sent the same dict and failed identically, burning a second login (#31).

Add a user_id property that logs in before returning the id, and read identity through it in add_serving and the v3 URL. Payloads are now built from authenticated state, so the retry only ever recovers a genuine token expiry.

add_serving() read self._user_id while building its payload, but on a
cold client _ensure_auth() hadn't run yet, so it froze userId=null and
Cronometer rejected the write. The retry re-sent the same dict and
failed identically, burning a second login (#31).

Add a user_id property that logs in before returning the id, and read
identity through it in add_serving and the v3 URL. Payloads are now
built from authenticated state, so the retry only ever recovers a
genuine token expiry.
@rwestergren
rwestergren merged commit 3a3ab7c into main Aug 2, 2026
1 check passed
@rwestergren
rwestergren deleted the fix-cold-start-add-serving-auth branch August 2, 2026 13:53
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