Skip to content

fix: fail at session() initialization when account is missing#240

Merged
brendanjryan merged 1 commit intomainfrom
brendanryan/session-require-account
Mar 25, 2026
Merged

fix: fail at session() initialization when account is missing#240
brendanjryan merged 1 commit intomainfrom
brendanryan/session-require-account

Conversation

@brendanjryan
Copy link
Copy Markdown
Collaborator

@brendanjryan brendanjryan commented Mar 25, 2026

Problem

When tempo.session() is configured without a viem Account, the server starts up fine but fails later with an opaque error during a channel close request:

Cannot close channel: no account available. Provide an `account` in the session config or a `getClient` that returns an account-bearing client.

Fix

Now session() throws immediately at initialization with a clear, actionable message:

tempo.session() requires an `account` (viem Account, e.g. privateKeyToAccount("0x...")).
An address string is not sufficient — the server needs a signing account for on-chain
channel close and settlement.

Companion docs PR: tempoxyz/mpp#460

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 25, 2026

Open in StackBlitz

npm i https://pkg.pr.new/mppx@240

commit: 1bfed6a

@brendanjryan brendanjryan force-pushed the brendanryan/session-require-account branch 2 times, most recently from 7891d04 to c49808c Compare March 25, 2026 17:51
@brendanjryan brendanjryan changed the title feat: make account required for server-side session() fix: improve session close error message with actionable guidance Mar 25, 2026
@brendanjryan brendanjryan force-pushed the brendanryan/session-require-account branch from c49808c to d04d086 Compare March 25, 2026 17:54
@brendanjryan brendanjryan changed the title fix: improve session close error message with actionable guidance fix: fail at session() initialization when account is missing Mar 25, 2026
@brendanjryan brendanjryan force-pushed the brendanryan/session-require-account branch from d04d086 to e968e0f Compare March 25, 2026 17:56
@brendanjryan brendanjryan requested review from jxom and tmm March 25, 2026 17:58
@brendanjryan brendanjryan force-pushed the brendanryan/session-require-account branch from e968e0f to 78ce862 Compare March 25, 2026 18:02
tempo.session() now throws immediately at construction if no viem
Account is provided, rather than waiting for a channel close to fail
with an opaque error. The error message includes an example fix.

Also improves the closeOnChain error message for clarity.
@brendanjryan brendanjryan force-pushed the brendanryan/session-require-account branch from 78ce862 to 1bfed6a Compare March 25, 2026 18:05
@brendanjryan brendanjryan merged commit 3c713c9 into main Mar 25, 2026
6 of 7 checks passed
@brendanjryan brendanjryan deleted the brendanryan/session-require-account branch March 25, 2026 18:35
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