Skip to content

fix: unbreak shipped clients broken by #5337 - #5356

Merged
iscekic merged 3 commits into
mainfrom
fix/get-token-query-compat
Aug 18, 2026
Merged

fix: unbreak shipped clients broken by #5337#5356
iscekic merged 3 commits into
mainfrom
fix/get-token-query-compat

Conversation

@iscekic

@iscekic iscekic commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Two procedures in #5337 changed shape in ways that already-installed clients cannot follow. Both keep a compatible path with a TODO for its removal, and both keep the new path as the way forward.

1. activeSessions.getToken — the outage

Mobile shows "Could not load your account". Axiom pins it to deployment dpl_GWB6AQmWy8dgLjhUHCZ83SdQRycz (live 18:40 UTC 2026-08-18), which shipped #5337. That PR changed activeSessions.getToken from a query to a mutation.

Every already-installed client still calls it as a query. tRPC 11.17 then fails the call two ways:

  • plain GET /api/trpc/activeSessions.getToken405, the method map allows only POST for a mutation.
  • any batch that pairs it with a query → 400 Cannot mix procedure types in call: query, mutation, which fails the whole batch, user.getMe included. The mobile root layout reads that as a bootstrap error.

Confirmed across Android (okhttp/4.9.2), iOS (Kilo/97, 137, 143, 144), browsers and node. The previous deployments show zero of either status.

Fix

  • createWebTicket — new mutation, the path forward. Minting a one-use ticket is not idempotent, so it belongs on a mutation. Web, mobile and the extension now call it.
  • getToken — stays a query for clients that are already installed. Store builds and installed extensions cannot update in step with the server.
  • Both share one mintWebTicket handler, so behaviour cannot drift.

httpBatchLink keeps a separate loader per operation type, so the new mutation never batches beside a query.

Remove getToken once the mobile and extension releases that call createWebTicket have rolled out and its traffic in Axiom reaches zero.

2. user.requestAccountDeletion — required input

#5337 gave the mutation a required { challengeId, code }. Shipped builds call it with no input and now get a 400, so the delete-account flow is dead for them.

Fix

The input is optional again. With no input the mutation keeps the old support-ticket path: it emails the user and support, stamps the 1 h cooldown, and deletes nothing — exactly what those builds tell the user happened ("Account deletion request sent. Check your email for confirmation."). With a challenge it reauthenticates and performs the GDPR removal as #5337 intended.

No re-auth requirement is weakened: the input-less path never deletes.

Remove the branch, and make the input required again, once the mobile release that sends { challengeId, code } has rolled out and input-less traffic reaches zero.

Checks

  • pnpm run typecheck — clean
  • pnpm run lint — clean
  • mobile user-web-connection-provider tests — 2 passed
  • apps/web jest needs a local Postgres that is not running here, so the two new cases in active-sessions-router.test.ts and user-router.test.ts are unverified locally and ride on CI.

PR #5337 changed activeSessions.getToken from a query to a mutation.
Every installed client calls it as a query, so tRPC rejects the call:
405 on a plain GET, and 400 "Cannot mix procedure types in call" on any
batch that pairs it with user.getMe. The mobile app then shows
"Could not load your account".

Shipped app builds and installed extensions cannot be updated in step
with the server, so the procedure type must stay a query. The one-use
web-ticket body is unchanged.
Minting is not idempotent, so createWebTicket is a mutation and is the
path forward. Web, mobile and extension now call it.

getToken stays a query for clients that are already installed, with a
TODO for its removal. Shipped app builds and installed extensions cannot
update in step with the server, and tRPC answers a query-shaped call to
a mutation with 405, or fails the whole batch with 400 "Cannot mix
procedure types in call" when it sits beside a query.

Both procedures share one mintWebTicket handler.
@iscekic iscekic self-assigned this Aug 18, 2026
@kilo-code-bot

kilo-code-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (8 files)
  • apps/extension/entrypoints/sidepanel/agents-provider.tsx
  • apps/extension/tests/e2e/agents-fixture.ts
  • apps/mobile/src/components/agents/user-web-connection-provider.mounted.test.tsx
  • apps/mobile/src/components/agents/user-web-connection-provider.test.ts
  • apps/mobile/src/components/agents/user-web-connection-provider.tsx
  • apps/web/src/components/cloud-agent-next/CloudAgentProvider.tsx
  • apps/web/src/routers/active-sessions-router.test.ts
  • apps/web/src/routers/active-sessions-router.ts

Reviewed by grok-4.6 · Input: 58.6K · Output: 7.8K · Cached: 318.3K

Review guidance: REVIEW.md from base branch main

PR #5337 gave the mutation a required input, so builds already in the
stores get a 400 on the delete-account flow.

Make the input optional and keep the old support-ticket path for a
call without one: it emails the user and support, stamps the cooldown,
and deletes nothing, which is exactly what those builds tell the user
happened. A call with a challenge still reauthenticates and performs the
GDPR removal.

The branch carries a TODO for its removal.
@iscekic iscekic changed the title fix(active-sessions): unbreak shipped clients, add createWebTicket mutation fix: unbreak shipped clients broken by #5337 Aug 18, 2026
@iscekic
iscekic enabled auto-merge (squash) August 18, 2026 19:26
@iscekic
iscekic merged commit 44fe67d into main Aug 18, 2026
21 of 22 checks passed
@iscekic
iscekic deleted the fix/get-token-query-compat branch August 18, 2026 19:38
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.

2 participants