Clean up some sentry logs (#2630)
* Change prop name for sentry ingestion * Fix test * Add default object
This commit is contained in:
parent
3371038f7d
commit
bc502edae1
39 changed files with 84 additions and 147 deletions
|
@ -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,
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue