diff options
author | Eric Bailey <git@esb.lol> | 2024-01-25 23:11:01 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-25 21:11:01 -0800 |
commit | bc502edae150173d7b5ead0eddb739994929ac97 (patch) | |
tree | bfe4f3b9850d03339a73495db48977524bb510f8 /src/state/session/index.tsx | |
parent | 3371038f7d8b740f2415d3a54dc99b69e0598042 (diff) | |
download | voidsky-bc502edae150173d7b5ead0eddb739994929ac97.tar.zst |
Clean up some sentry logs (#2630)
* Change prop name for sentry ingestion * Fix test * Add default object
Diffstat (limited to 'src/state/session/index.tsx')
-rw-r--r-- | src/state/session/index.tsx | 55 |
1 files changed, 9 insertions, 46 deletions
diff --git a/src/state/session/index.tsx b/src/state/session/index.tsx index 629aff6dc..ed2e6fcf1 100644 --- a/src/state/session/index.tsx +++ b/src/state/session/index.tsx @@ -138,9 +138,6 @@ function createPersistSessionHandler( logger.info(`session: persistSession`, { event, - did: refreshedAccount.did, - handle: refreshedAccount.handle, - service: refreshedAccount.service, deactivated: refreshedAccount.deactivated, }) @@ -217,10 +214,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { verificationPhone, verificationCode, }: any) => { - logger.info(`session: creating account`, { - service, - handle, - }) + logger.info(`session: creating account`) track('Try Create Account') const agent = new BskyAgent({service}) @@ -272,14 +266,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { queryClient.clear() upsertAccount(account) - logger.debug( - `session: created account`, - { - service, - handle, - }, - logger.DebugContext.session, - ) + logger.debug(`session: created account`, {}, logger.DebugContext.session) track('Create Account') }, [upsertAccount, queryClient, clearCurrentAccount], @@ -287,14 +274,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { const login = React.useCallback<ApiContext['login']>( async ({service, identifier, password}) => { - logger.debug( - `session: login`, - { - service, - identifier, - }, - logger.DebugContext.session, - ) + logger.debug(`session: login`, {}, logger.DebugContext.session) const agent = new BskyAgent({service}) @@ -329,14 +309,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { queryClient.clear() upsertAccount(account) - logger.debug( - `session: logged in`, - { - service, - identifier, - }, - logger.DebugContext.session, - ) + logger.debug(`session: logged in`, {}, logger.DebugContext.session) track('Sign In', {resumedSession: false}) }, @@ -360,14 +333,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { const initSession = React.useCallback<ApiContext['initSession']>( async account => { - logger.debug( - `session: initSession`, - { - did: account.did, - handle: account.handle, - }, - logger.DebugContext.session, - ) + logger.debug(`session: initSession`, {}, logger.DebugContext.session) const agent = new BskyAgent({ service: account.service, @@ -435,7 +401,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { * we handle that failure via `createPersistSessionHandler` */ logger.info(`session: resumeSessionWithFreshAccount failed`, { - error: e, + message: e, }) __globalAgent = PUBLIC_BSKY_AGENT @@ -454,7 +420,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { * we handle that failure via `createPersistSessionHandler` */ logger.info(`session: resumeSessionWithFreshAccount failed`, { - error: e, + message: e, }) __globalAgent = PUBLIC_BSKY_AGENT @@ -497,7 +463,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { await initSession(account) } } catch (e) { - logger.error(`session: resumeSession failed`, {error: e}) + logger.error(`session: resumeSession failed`, {message: e}) } finally { setState(s => ({ ...s, @@ -613,10 +579,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { } else if (!session.currentAccount && state.currentAccount) { logger.debug( `session: persisted onUpdate, logging out`, - { - did: state.currentAccount?.did, - handle: state.currentAccount?.handle, - }, + {}, logger.DebugContext.session, ) |