Skip to content

fix: await whoami output in compat login --no-browser path - #98

Open
memosr wants to merge 1 commit into
tempoxyz:mainfrom
memosr:fix/await-compat-login-whoami
Open

fix: await whoami output in compat login --no-browser path#98
memosr wants to merge 1 commit into
tempoxyz:mainfrom
memosr:fix/await-compat-login-whoami

Conversation

@memosr

@memosr memosr commented Aug 20, 2026

Copy link
Copy Markdown

Problem

handleCompatCommand passes the result of currentWhoamiOutput() straight into printCompatOutput without awaiting it. currentWhoamiOutput is async, so a Promise reaches JSON.stringify, which serialises it as {}.

Running tempo wallet login --no-browser with an already-configured wallet prints {} instead of the wallet, balance and key payload. Anything scripting against that output gets an empty object.

Why it slipped through

  • printCompatOutput(value: unknown, ...) accepts the promise without a type error.
  • The promise is passed as an argument rather than left floating, so no-floating-promises does not flag it.
  • The other two call sites in the same function (listSessions, runFundingFlow) are awaited correctly, so only this branch is affected.

Fix

Adds the missing await.

Test

test/compat.test.ts asserts the printed payload parses and contains wallet, balance and key.

Verified it actually catches the regression: with the await removed the assertion fails with expected undefined to be '0xabfb663c...', because the serialised promise is {}.

pnpm test (147 passed), pnpm typecheck, pnpm test:types, pnpm changelog:validate, pnpm check:format and pnpm check:lint are all green.

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