Skip to content

Commit

Permalink
Reduce some Sentry logs (#2549)
Browse files Browse the repository at this point in the history
* Reduce some Sentry logs

* Update tests
  • Loading branch information
estrattonbailey authored Jan 16, 2024
1 parent 64f7800 commit 9cbd3c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/state/persisted/__tests__/migrate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('migrate: fresh install', async () => {

expect(AsyncStorage.getItem).toHaveBeenCalledWith('root')
expect(read).toHaveBeenCalledTimes(1)
expect(logger.log).toHaveBeenCalledWith(
expect(logger.info).toHaveBeenCalledWith(
'persisted state: no migration needed',
)
})
Expand All @@ -38,7 +38,7 @@ test('migrate: fresh install, existing new storage', async () => {

expect(AsyncStorage.getItem).toHaveBeenCalledWith('root')
expect(read).toHaveBeenCalledTimes(1)
expect(logger.log).toHaveBeenCalledWith(
expect(logger.info).toHaveBeenCalledWith(
'persisted state: no migration needed',
)
})
Expand Down Expand Up @@ -68,7 +68,7 @@ test('migrate: has legacy data', async () => {
await migrate()

expect(write).toHaveBeenCalledWith(transform(fixtures.LEGACY_DATA_DUMP))
expect(logger.log).toHaveBeenCalledWith(
expect(logger.info).toHaveBeenCalledWith(
'persisted state: migrated legacy storage',
)
})
Expand Down
4 changes: 2 additions & 2 deletions src/state/persisted/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ export async function migrate() {

if (validate.success) {
await write(newData)
logger.log('persisted state: migrated legacy storage')
logger.info('persisted state: migrated legacy storage')
} else {
logger.error('persisted state: legacy data failed validation', {
error: validate.error,
})
}
} else {
logger.log('persisted state: no migration needed')
logger.info('persisted state: no migration needed')
}
} catch (e: any) {
logger.error(e, {
Expand Down
3 changes: 2 additions & 1 deletion src/state/queries/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ export function usePinnedFeedsInfos(): {
},
})
} catch (e) {
logger.warn(`usePinnedFeedsInfos: failed to fetch ${uri}`, {
// expected failure
logger.info(`usePinnedFeedsInfos: failed to fetch ${uri}`, {
error: e,
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/state/queries/notifications/unread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
}
broadcast.postMessage({event: unreadCountStr})
} catch (e) {
logger.error('Failed to check unread notifications', {error: e})
logger.warn('Failed to check unread notifications', {error: e})
}
},

Expand Down

0 comments on commit 9cbd3c0

Please sign in to comment.