Skip to content

A delegated call's transaction is bound to its user - #232

Draft
carlenmy wants to merge 1 commit into
mainfrom
delegated-call-context
Draft

carlenmy wants to merge 1 commit into
mainfrom
delegated-call-context

Conversation

@carlenmy

Copy link
Copy Markdown

Draft: depends on linked-fw/server-utils#125 (the delegated call context, @_linked/server-utils 1.18). The range here reads ^1.18.0; the lockfile is refreshed once that release exists, so CI fails until then.

What

  • transactionCaller() binds a store transaction started in a delegated call (runAsDelegate) to the user the delegate acts for — user:<id>, the same identity as that user's own request — instead of system. A delegated account without an id is refused (401), as an HTTP call without a session is.
  • README: the transaction caller, and RemoteDataset's user token (a delegated call has a user but no session token, so none is sent).
  • A patch changeset.

Why

Bound to system, a delegated caller's transaction could be continued by any system work. Bound to its user, it behaves exactly like that user's own.

Tests

src/tests/transaction-caller.test.ts: http with and without a session; delegated → user:<id> and equal to the user's own request; delegated without an id → 401; system and outside any call → system (control). npm test: 553 pass (run against the server-utils branch linked locally).

🤖 Generated with Claude Code

https://claude.ai/code/session_01BcfKmNq1KK5uCkbJAKTEmQ

Needs @_linked/server-utils 1.18 (the delegated call context). The lockfile
is refreshed once that version is published.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BcfKmNq1KK5uCkbJAKTEmQ
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