mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 18:53:29 +00:00
[PM-7687] Fix reloadPopup Recursion (#8902)
* Fix Message Sending Recursion * Remove Change That Didn't Help * Prefer `isExternalMessage` Guard * Rollback Compare Change --------- Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
This commit is contained in:
@@ -10,7 +10,7 @@ import { SystemService } from "@bitwarden/common/platform/abstractions/system.se
|
|||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||||
|
|
||||||
import { MessageListener } from "../../../../libs/common/src/platform/messaging";
|
import { MessageListener, isExternalMessage } from "../../../../libs/common/src/platform/messaging";
|
||||||
import {
|
import {
|
||||||
closeUnlockPopout,
|
closeUnlockPopout,
|
||||||
openSsoAuthResultPopout,
|
openSsoAuthResultPopout,
|
||||||
@@ -266,7 +266,9 @@ export default class RuntimeBackground {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "reloadPopup":
|
case "reloadPopup":
|
||||||
|
if (isExternalMessage(msg)) {
|
||||||
this.messagingService.send("reloadPopup");
|
this.messagingService.send("reloadPopup");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "emailVerificationRequired":
|
case "emailVerificationRequired":
|
||||||
this.messagingService.send("showDialog", {
|
this.messagingService.send("showDialog", {
|
||||||
|
|||||||
@@ -92,10 +92,17 @@ export class LocalBackedSessionStorageService
|
|||||||
// This is for observation purposes only. At some point, we don't want to write to local session storage if the value is the same.
|
// This is for observation purposes only. At some point, we don't want to write to local session storage if the value is the same.
|
||||||
if (this.platformUtilsService.isDev()) {
|
if (this.platformUtilsService.isDev()) {
|
||||||
const existingValue = this.cache[key] as T;
|
const existingValue = this.cache[key] as T;
|
||||||
|
try {
|
||||||
if (this.compareValues<T>(existingValue, obj)) {
|
if (this.compareValues<T>(existingValue, obj)) {
|
||||||
this.logService.warning(`Possible unnecessary write to local session storage. Key: ${key}`);
|
this.logService.warning(
|
||||||
|
`Possible unnecessary write to local session storage. Key: ${key}`,
|
||||||
|
);
|
||||||
this.logService.warning(obj as any);
|
this.logService.warning(obj as any);
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
this.logService.warning(`Error while comparing values for key: ${key}`);
|
||||||
|
this.logService.warning(err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user