Skip to content

fix(platform): return operator session expiry as ISO UTC from confirmation GET - #383

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/operator-session-expiry-iso
Oct 8, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
fix/operator-session-expiry-iso

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

Problem

POST /operator/v1/session (elevation) serializes expiresAt with toISOString() → 2026-10-07T12:13:32.000Z. GET /operator/v1/session (confirmation) passed the column value through raw: operator_sessions.expires_at is timestamp without time zone, and the string-mode column mapping returns SQL text 2026-10-07 12:13:32 — same instant, different text. The iOS admin gate validates ISO UTC and rejected the confirmation response (admin-session-confirm incompatibleResponse, status 200).

Fix

In the confirmation handler only: parse the timezone-less wall time explicitly as UTC (T separator, +00:00 — no assumed bare suffix, no runtime-local guessing) and serialize with toISOString(). The response now carries the same instant and the same ISO text the elevation issued. The middleware context value is untouched and nothing else reads it, so blast radius is this one response.

Test evidence (observed, not expected)

New regression test round-trips the expiry through the real database conversion (PGlite) and asserts both responses carry byte-identical ISO text plus the full shape the app validates (apiVersion 1, same user, eight capability flags as booleans, hostedWorkerOperations a boolean).

  • Old code: 7 of 8 pass; the new test fails with the app's exact complaint — expected '2026-10-07 12:13:32' to be '2026-10-07T12:13:32.000Z'
  • With this patch: all 8 of 8 pass — elevation, drain maintenance, role/suspension enforcement, forgery rejection, dev-bypass rejection, and input validation all unaffected
vp test run --project platform-api-integration platform/packages/api/test/integration/operator-auth.test.ts

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T15:02:49.007291Z 848282d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-operator-session-expiry-iso-void-cloud.voidzero-docs.workers.dev (commit 848282d)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://bd38d5d0-void-cloud.voidzero-docs.workers.dev 848282d 2026-10-07T15:03:53.708Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ef43a6fb-void-cloud.voidzero-docs.workers.dev 4f7ba3c 2026-10-07T14:17:34.649Z Visit the dashboard ↗
  • Build: Failed ❌

View logs ↗
80e9f86 2026-10-07T14:06:55.092Z View logs ↗

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80e9f864dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ios-admin/Void/Models.swift Outdated
Comment thread ios-admin/Void/Models.swift Outdated
Comment thread ios-admin/Void/API.swift Outdated
Comment thread ios-admin/Void/Models.swift Outdated
@Brooooooklyn
Brooooooklyn force-pushed the fix/operator-session-expiry-iso branch 2 times, most recently from 4f7ba3c to 5479b68 Compare October 7, 2026 14:58
…ation GET

operator_sessions.expires_at is timestamp without time zone; the
string-mode column mapping returns SQL text ('2026-10-07 12:13:32')
while the elevation POST serializes with toISOString(). The iOS admin
gate validates ISO UTC and rejected the confirmation response
(admin-session-confirm incompatibleResponse, status 200).

Parse the timezone-less wall time explicitly as UTC and serialize with
toISOString() so confirmation returns the same instant and the same
text the elevation issued.

Adds a regression test that round-trips the expiry through the real
database conversion and asserts both responses carry byte-identical
ISO text plus the full shape the app validates. Observed: fails on the
old code ('2026-10-07 12:13:32' vs '2026-10-07T12:13:32.000Z'),
passes 8/8 with the fix.
@Brooooooklyn
Brooooooklyn force-pushed the fix/operator-session-expiry-iso branch from 5479b68 to 848282d Compare October 7, 2026 15:00
@Brooooooklyn
Brooooooklyn merged commit faea0ec into main Oct 8, 2026
20 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/operator-session-expiry-iso branch October 8, 2026 04:34
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