Compare commits

...

1 Commits

Author SHA1 Message Date
Eric Bailey 18493e1221 Fix current session refresh bug 2026-03-06 10:44:48 -06:00
2 changed files with 6 additions and 13 deletions
-13
View File
@@ -72,19 +72,6 @@ export async function createAgentAndResume(
await networkRetry(1, () => agent.resumeSession(prevSession))
} else {
agent.sessionManager.session = prevSession
if (!storedAccount.signupQueued) {
networkRetry(3, () => agent.resumeSession(prevSession)).catch(
(e: any) => {
logger.error(`networkRetry failed to resume session`, {
status: e?.status || 'unknown',
// this field name is ignored by Sentry scrubbers
safeMessage: e?.message || 'unknown',
})
throw e
},
)
}
}
// after session is attached
+6
View File
@@ -321,6 +321,12 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
)
if (syncedAccount && syncedAccount.refreshJwt) {
if (syncedAccount.did !== state.currentAgentState.did) {
/*
* Web handling: if leader tab has switched to a diff account that is
* stale, it will refresh the session before triggering the update to
* follower tabs. Follower tabs will therefore receive the fresh
* session. See APP-1960, or ask Eric.
*/
resumeSession(syncedAccount)
} else {
const agent = state.currentAgentState.agent as BskyAgent