Skip to content

Commit

Permalink
Stop waiting for authService.refreshUserInfo on BG init
Browse files Browse the repository at this point in the history
- This brings the SW wake time down from 2-4s to 70ms!!!
- Confused why this was waited for in the first place when my inline comment above it says "don't wait for it"
- Things should be set up to use the auth service events
  • Loading branch information
poltak committed Apr 5, 2024
1 parent 2deafb2 commit a63009a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/background-script/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -788,14 +788,12 @@ export async function setupBackgroundModules(
backgroundModules.imageSupport.setupRemoteFunctions()
setupNotificationClickListener()

// TODO mv3: migrate web req APIs
// await backgroundModules.pdfBg.setupRequestInterceptors()
await backgroundModules.analytics.setup()
backgroundModules.analytics.setup()
await backgroundModules.jobScheduler.setup()
await backgroundModules.pageActivityIndicator.setup()

// Ensure log-in state gotten from FB + trigger share queue processing, but don't wait for it
await backgroundModules.auth.authService.refreshUserInfo()
// Ensure log-in state gotten from FB + trigger sync queue processing, but don't wait for it
backgroundModules.auth.authService.refreshUserInfo()
await backgroundModules.personalCloud.setup()
}

Expand Down

0 comments on commit a63009a

Please sign in to comment.