Repository navigation
ref(web): Use the User id for web Actors - #2630
Conversation
Web Actors now use the internal User id instead of dashboard:<sha256(email)[:24]>. Junior is the web provider, so the User id is the provider-scoped Actor id. Input, web authorizations, and OAuth credentials saved under the legacy id before the deploy keep working: viewer checks accept both ids, and token and MCP credential reads move legacy keys to the User id on a miss. Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
1 screenshot change — 1 changed · 0 added · 0 removed Review screenshots in Frameshift
|
dcramer
left a comment
There was a problem hiding this comment.
generally should be good. we should be identifying users at the edge, and then translating that to internal IDs etc (tho in the web the session cookie should already identify their user ID)
need to get the tests passing or disqualify the failure
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1cd2e23. Configure here.
|
The
|
A read moves legacy dashboard credentials only when the User id has none, so a disconnect could leave the legacy key and a later read brought the connection back. Delete both keys for OAuth tokens and MCP credentials.
…ests event-wake-delay still asserted the old Event prose. It timed out in the sandbox before it reached the assertions. web-batch-messages still called webActorFromEmail, which #2630 removed.
Main CI on 38c8693 (#2625) fails `check / types`, `test / junior unit`, and `test / dashboard e2e`. **Types and unit.** #2625 added `web-batch-messages.test.ts` with `webActorFromEmail`. #2630 removed it. The test now uses `webActorFromUser(testViewer(...))`, the same fix as c1e36af in #2631. **Dashboard e2e.** `conversations-mobile.spec.ts` "keeps the message in view while earlier history and late content load" is flaky. It is not a regression from #2622 or #2625: - Main CI: failed on f23838b (#2622, which only changes `ReviewItemContext.tsx`) and 38c8693. Passed only on retry on 38597fb. Each of these failed at line 752, the last step (spacer above the reader). - #2634 added `scrollIntoViewIfNeeded()` right before that step. The scroll event fires on the next frame. When the test appends the spacer first, the transcript's scroll handler records the reader's place from the layout that already has the spacer. The resize correction then sees no shift. Local logs showed this order in every failure and the opposite order in every pass. - The test now waits one frame after each scroll so the scroll event runs first. Assertions are unchanged. Locally the last step went from 6 failures in 16 runs to 0 in 160. **Still open.** Under 4 parallel workers, 7 of the 160 local runs failed one step earlier (after the earlier page loads). I did not measure that step on main without this change. In the one failure I logged, the correction ran twice: `scrollTop` moved by exactly 2× the shift. That points to a product race in `transcriptBottomPinning.ts`, not a test race. This PR does not fix it. I have not seen it fail in CI. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A586024895340456299c9cfbe04e88e91 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A586024895340456299c9cfbe04e88e91) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A586024895340456299c9cfbe04e88e91/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <23610+dcramer@users.noreply.github.com>
…ests event-wake-delay still asserted the old Event prose. It timed out in the sandbox before it reached the assertions. web-batch-messages still called webActorFromEmail, which #2630 removed.

Web Actors now use the internal User
id. Before this change they useddashboard:plus the first 24 hex characters of sha256(email).webActorFromEmail(email)is nowwebActorFromUser(user).ID format
The bare
user.id, with no prefix. On web, Junior is the provider, so the User id is the provider-scoped id. Actors already carryplatform. Keys that span platforms already add it (provenance, agent invocation, memoryweb:${userId}), so aweb:prefix would giveweb:web:<id>. User ids are UUIDs, so they cannot collide with SlackU…/W…ids or local ids in flat keyspaces.Prompt keys (
user_id,actor_id,author_id) do not change. Only their value changes.Call sites
api/acp/conversations.ts,api/connections/routes.ts,api/conversations/{create,fork}.ts,chat/conversations/fork.ts(now takesviewer: User), andchat/review-items/messages.ts. Evals fixtures (history.ts,agent.ts,recorded.ts) follow. The recorded sanitizer replaces web User ids withweb-userN.Legacy ids
chat/conversations/legacy-web-actor-id.tsholds the old hash. Each caller has a TODO that says when to delete it.stop.ts,pending-messages.ts, andsteer-pending-messages.tsaccept the User id or the legacy id for the same viewer. Pending messages queued before the deploy still match.sql/event-actor.tskeeps the SQL reverse lookup as a read-only fallback fordashboard:authors.withLegacyWebTokens(user token store and sandbox egress) and the MCP credential read move tokens to the User id on a miss. They also delete the legacy key, so a later disconnect cannot bring it back. The lookup reads the database only for UUID-shaped ids.TERMINOLOGY.md: a web Actor id is the User id.Rolling-deploy risk
While old and new instances both run:
No data migration. Nothing is deleted except moved legacy token keys.
Tests
recorded.test.ts.pnpm typecheck,pnpm lint, prettier, oxlint,file-length:check, and the focused, MCP, andapi/conversationssuites.mainor need S3. watched-message-behavior is flaky and passes alone.behavioralandintegrationsuites before merge.via @dcramer.
--
View Session [Sentry]