Skip to content

fix(ssh): decode auth timestamps from JSON strings#2694

Open
ardenworks wants to merge 2 commits into
pingdotgg:mainfrom
ardenworks:fix-ssh-auth-timestamps
Open

fix(ssh): decode auth timestamps from JSON strings#2694
ardenworks wants to merge 2 commits into
pingdotgg:mainfrom
ardenworks:fix-ssh-auth-timestamps

Conversation

@ardenworks
Copy link
Copy Markdown

@ardenworks ardenworks commented May 14, 2026

What Changed

Use Schema.DateTimeUtcFromString for auth response timestamp fields that are decoded from HTTP JSON responses.

Why

Fixes #2665.

Desktop SSH pairing calls /api/auth/bootstrap/bearer. The remote server returns HTTP 200 with expiresAt serialized as an ISO string, but the desktop contract decoder currently expects a DateTimeUtc value.

That makes pairing fail during desktop:bootstrap-ssh-bearer-session even though the remote API request succeeds.

This fixes the mismatch by using the schema variant that accepts ISO timestamp strings from JSON and decodes them into DateTime.Utc values. The related auth response schemas are updated together because they use the same serialized timestamp shape over HTTP.

UI Changes

None.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
Low risk schema change confined to auth contract decoding; main risk is unintended behavior if any callers relied on the previous DateTimeUtc input shape.

Overview
Fixes auth response decoding by switching multiple timestamp fields in packages/contracts/src/auth.ts from Schema.DateTimeUtc to Schema.DateTimeUtcFromString (e.g., expiresAt, issuedAt, createdAt, lastConnectedAt). This aligns contract decoding with HTTP JSON responses that serialize datetimes as ISO strings, unblocking flows like bearer bootstrap/SSH pairing.

Reviewed by Cursor Bugbot for commit 978492b. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix auth timestamp decoding by switching to DateTimeUtcFromString in auth contracts

All timestamp fields in auth-related structs in auth.ts now use DateTimeUtcFromString instead of DateTimeUtc to correctly parse ISO 8601 datetime strings returned from the SSH auth API. This affects expiresAt, issuedAt, createdAt, and lastConnectedAt fields across AuthBootstrapResult, AuthBearerBootstrapResult, AuthWebSocketTokenResult, AuthPairingCredentialResult, AuthPairingLink, AuthClientSession, and AuthSessionState.

Macroscope summarized 978492b.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f4b3caaa-1240-4d99-8931-d9b658a4730e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels May 14, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 14, 2026

Approvability

Verdict: Approved

Straightforward bug fix that mechanically updates timestamp schema types from DateTimeUtc to DateTimeUtcFromString to properly decode JSON string representations. The change is consistent across all affected auth contracts with clear intent and limited scope.

You can customize Macroscope's approvability policy. Learn more.

@Xanacas
Copy link
Copy Markdown
Contributor

Xanacas commented May 16, 2026

Manually confirmed. I ran into the same issue and was able to fix it by applying the batch from within this PR.

@RoyLeviGit
Copy link
Copy Markdown

verified locally, this fixed my issue.

Copy link
Copy Markdown

@RoyLeviGit RoyLeviGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verified locally, fixed issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T3 Code Desktop 0.0.23 fails SSH environment pairing due to DateTime schema mismatch

3 participants