@@ -1546,19 +1546,10 @@ function purgeObsoleteData() {
15461546}
15471547
15481548async function initializeAccount ( ) {
1549- let lastStep = 'start' ;
1550- const timeout = setTimeout ( ( ) => {
1551- const error = new Error ( `account init timeout after step: ${ lastStep } ` ) ;
1552- error . name = 'AccountTimeoutError' ;
1553- ErrorReporter . captureException ( error ) ;
1554- alwaysLog ( error ) ;
1555- } , 5000 ) ;
1556-
15571549 try {
15581550 try {
15591551 // try to get user session from ghostery.com cookie
15601552 await account . getUser ( ) ;
1561- lastStep = 'getUser' ;
15621553 } catch ( e ) {
15631554 // expected if the user is not logged in
15641555 }
@@ -1568,33 +1559,26 @@ async function initializeAccount() {
15681559 if ( globals . JUST_INSTALLED ) {
15691560 setGhosteryDefaultBlocking ( ) ;
15701561 }
1571- lastStep = 'setGhosteryDefaultBlocking' ;
15721562 return ;
15731563 }
15741564
15751565 try {
1576- lastStep = 'beforeGetUserSubscriptionData' ;
15771566 await account . getUserSubscriptionData ( ) ;
1578- lastStep = 'afterGetUserSubscriptionData' ;
15791567 } catch ( e ) {
15801568 // expected if the user does not have active subscription
15811569 }
15821570
15831571 ghosteryDebugger . addAccountEvent ( 'app started' , 'signed in' , conf . account ) ;
15841572
15851573 await account . getUserSettings ( ) ;
1586- lastStep = 'getUserSettings' ;
15871574
15881575 if ( conf . current_theme !== 'default' ) {
15891576 await account . getTheme ( conf . current_theme ) ;
1590- lastStep = 'getTheme' ;
15911577 }
15921578 } catch ( e ) {
15931579 ErrorReporter . captureException ( e ) ;
15941580 e . name = 'AccountError' ;
15951581 alwaysLog ( e ) ;
1596- } finally {
1597- clearTimeout ( timeout ) ;
15981582 }
15991583}
16001584
@@ -1623,52 +1607,32 @@ async function recordUTMs() {
16231607 * @memberOf Background
16241608 */
16251609async function init ( ) {
1626- let lastStep = 'start' ;
1627- const timeout = setTimeout ( ( ) => {
1628- const error = new Error ( lastStep ) ;
1629- error . name = 'InitTimeoutError' ;
1630- ErrorReporter . captureException ( error ) ;
1631- alwaysLog ( error ) ;
1632- } , 20000 ) ;
1633-
16341610 try {
16351611 await confData . init ( ) ;
1636- lastStep = 'confData.init' ;
16371612
16381613 metrics . init ( ) ;
1639- lastStep = 'metrics.init' ;
16401614
16411615 initializePopup ( ) ;
1642- lastStep = 'initializePopup' ;
16431616
16441617 initializeEventListeners ( ) ;
1645- lastStep = 'initializeEventListeners' ;
16461618
16471619 initializeVersioning ( ) ;
1648- lastStep = 'initializeVersioning' ;
16491620
16501621 if ( globals . JUST_UPGRADED ) {
16511622 await purgeObsoleteData ( ) ;
1652- lastStep = 'purgeObsoleteData' ;
16531623 await freeSpaceIfNearQuota ( { force : true } ) ; // TODO: consider dropping "force" once all users upgraded
1654- lastStep = 'freeSpaceIfNearQuota' ;
16551624 }
16561625
16571626 initializeSearchMessageHandler ( ) ;
1658- lastStep = 'initializeSearchMessageHandler' ;
16591627
16601628 await recordUTMs ( ) ;
1661- lastStep = 'recordUTMs' ;
16621629
16631630 await initializeGhosteryModules ( ) ;
1664- lastStep = 'initializeGhosteryModules' ;
16651631
16661632 await initializeAccount ( ) ;
1667- lastStep = 'initializeAccount' ;
16681633
16691634 // persist Conf properties to storage only after init has completed
16701635 await prefsSet ( globals . initProps ) ;
1671- lastStep = 'prefsSet' ;
16721636
16731637 globals . INIT_COMPLETE = true ;
16741638
@@ -1680,8 +1644,6 @@ async function init() {
16801644 alwaysLog ( 'Error in init()' , err ) ;
16811645
16821646 throw err ;
1683- } finally {
1684- clearTimeout ( timeout ) ;
16851647 }
16861648}
16871649
0 commit comments