@@ -473,12 +473,13 @@ injections mode isBackend isLocalDev =
473473 return Math.floor(hrTime[0] * 1000000 + hrTime[1] / 1000);
474474 }
475475
476- var isBuried = false ;
476+ var buriedTimestamp = null ;
477477
478478 function sendToApp(msg, viewMetadata)
479479 {
480- if (isBuried) {
481- bugsnag.notify(new Error('Got message after app was buried: ' + (msg.$ || '(unknown message)')));
480+ if (buriedTimestamp !== null) {
481+ const elapsed = Date.now() - buriedTimestamp;
482+ bugsnag.notify(new Error('Got message ' + elapsed + ' ms after app was buried: ' + (msg.$ || '(unknown message)')));
482483 return;
483484 }
484485
@@ -526,7 +527,7 @@ injections mode isBackend isLocalDev =
526527 const die = function() {
527528 // In case there still are any pending commands, setting this flag means
528529 // that nothing happens when they finish.
529- isBuried = true ;
530+ buriedTimestamp = Date.now() ;
530531
531532 // The app won't be garbage collected until all pending commands are done.
532533 // We can reclaim most memory immediately by manually clearing the model early.
@@ -665,12 +666,13 @@ injections mode isBackend isLocalDev =
665666 //console.log('managers', managers)
666667 //console.log('ports', ports)
667668
668- var isBuried = false ;
669+ var buriedTimestamp = null ;
669670
670671 function sendToApp(msg, viewMetadata)
671672 {
672- if (isBuried) {
673- window.lamdera.bs.notify(new Error('Got message after app was buried: ' + (msg.$ || '(unknown message)')));
673+ if (buriedTimestamp !== null) {
674+ const elapsed = Date.now() - buriedTimestamp;
675+ window.lamdera.bs.notify(new Error('Got message ' + elapsed + ' ms after app was buried: ' + (msg.$ || '(unknown message)')));
674676 return;
675677 }
676678
@@ -743,7 +745,7 @@ injections mode isBackend isLocalDev =
743745 const bury = function() {
744746 // In case there still are any pending commands, setting this flag means
745747 // that nothing happens when they finish.
746- isBuried = true ;
748+ buriedTimestamp = Date.now() ;
747749
748750 // The app won't be garbage collected until all pending commands are done.
749751 // We can reclaim most memory immediately by manually clearing the model early.
0 commit comments