diff options
Diffstat (limited to 'src/state/session/index.tsx')
-rw-r--r-- | src/state/session/index.tsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/state/session/index.tsx b/src/state/session/index.tsx index 56208bc70..7cdbe6bb8 100644 --- a/src/state/session/index.tsx +++ b/src/state/session/index.tsx @@ -361,6 +361,8 @@ export function Provider({children}: React.PropsWithChildren<{}>) { } if (canReusePrevSession) { + logger.info(`session: attempting to reuse previous session`) + agent.session = prevSession __globalAgent = agent queryClient.clear() @@ -370,6 +372,9 @@ export function Provider({children}: React.PropsWithChildren<{}>) { resumeSessionWithFreshAccount() .then(freshAccount => { if (JSON.stringify(account) !== JSON.stringify(freshAccount)) { + logger.info( + `session: reuse of previous session returned a fresh account, upserting`, + ) upsertAccount(freshAccount) } }) @@ -385,6 +390,8 @@ export function Provider({children}: React.PropsWithChildren<{}>) { __globalAgent = PUBLIC_BSKY_AGENT }) } else { + logger.info(`session: attempting to resume using previous session`) + try { const freshAccount = await resumeSessionWithFreshAccount() __globalAgent = agent @@ -404,6 +411,8 @@ export function Provider({children}: React.PropsWithChildren<{}>) { } async function resumeSessionWithFreshAccount(): Promise<SessionAccount> { + logger.info(`session: resumeSessionWithFreshAccount`) + await networkRetry(1, () => agent.resumeSession(prevSession)) /* |