You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Fix probe() returning undefined after ingestSessionFromRedirect (#2409)
## Summary
Fixes a regression introduced in #2401 where `SessionProvider.probe()`
would always return undefined after calling
`ingestSessionFromRedirect()` on a deep link redirect (Capacitor, mobile
apps, etc).
**Root cause:** #2401 moved session restoration into `_init()`, which
runs once during construction. For deep links, the session data arrives
*after* construction via `ingestSessionFromRedirect()`, so `_init()`
never sees it. Result: `probe()` had no path to create the account.
**Solution:** Restore on-demand session retrieval in public methods
(`probe()`, `connect()`, `username()`), matching the pre-#2401 behavior.
Both web redirects (query param flow) and deep links (explicit call
flow) now work correctly.
## Changes
- Split initialization: `_setSigningKeys()` (sync) handles signer setup,
`_resolvePreset()` (async) handles preset resolution
- Restore on-demand account retrieval: `tryRetrieveSessionAccount()`
called by public methods when account not set
- Rename `tryRetrieveFromQueryOrStorage` → `tryRetrieveSessionAccount`
for clarity and mark as private
- Add comments explaining the two session entry points (localStorage and
URL query params)
- Improve variable naming: `_ready` → `_readyPromise`
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
0 commit comments