mirror of
https://github.com/bitwarden/browser
synced 2026-02-11 22:13:32 +00:00
address PR feedback: 'Consider error handling in do/while loop' and prevent an infinite loop
This commit is contained in:
@@ -213,7 +213,13 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
do {
|
||||
this.shouldRerunAuthRequestProcessing = false;
|
||||
await this.processPendingAuthRequests();
|
||||
|
||||
try {
|
||||
await this.processPendingAuthRequests();
|
||||
} catch (error) {
|
||||
this.logService.error(`Error processing pending auth requests: ${error}`);
|
||||
this.shouldRerunAuthRequestProcessing = false; // Reset flag to prevent infinite loop on persistent errors
|
||||
}
|
||||
// If an "openLoginApproval" message was received while processPendingAuthRequests() was running, then
|
||||
// shouldRerunAuthRequestProcessing will have been set to true
|
||||
} while (this.shouldRerunAuthRequestProcessing);
|
||||
|
||||
@@ -521,11 +521,16 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
do {
|
||||
this.shouldRerunAuthRequestProcessing = false;
|
||||
await this.processPendingAuthRequests();
|
||||
|
||||
try {
|
||||
await this.processPendingAuthRequests();
|
||||
} catch (error) {
|
||||
this.logService.error(`Error processing pending auth requests: ${error}`);
|
||||
this.shouldRerunAuthRequestProcessing = false; // Reset flag to prevent infinite loop on persistent errors
|
||||
}
|
||||
// If an "openLoginApproval" message was received while processPendingAuthRequests() was running, then
|
||||
// shouldRerunAuthRequestProcessing will have been set to true
|
||||
} while (this.shouldRerunAuthRequestProcessing);
|
||||
|
||||
break;
|
||||
case "redrawMenu":
|
||||
await this.updateAppMenu();
|
||||
|
||||
Reference in New Issue
Block a user