Remove localStorage write verification
This commit is contained in:
@@ -226,7 +226,7 @@ Tab A action: broadcast update notification
|
|||||||
|
|
||||||
Broadcasting after a failed write would tell Tab B to reread localStorage while it still contains `(7, A)`, spreading the stale generation instead of the new one.
|
Broadcasting after a failed write would tell Tab B to reread localStorage while it still contains `(7, A)`, spreading the stale generation instead of the new one.
|
||||||
|
|
||||||
After successfully writing and verifying localStorage, notify other tabs:
|
After successfully writing localStorage, notify other tabs:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
broadcast.postMessage({
|
broadcast.postMessage({
|
||||||
@@ -310,7 +310,7 @@ Read authoritative localStorage state
|
|||||||
Conditionally commit against active base jti
|
Conditionally commit against active base jti
|
||||||
|
|
|
|
||||||
v
|
v
|
||||||
Write and verify localStorage
|
Write localStorage
|
||||||
|
|
|
|
||||||
+-- failure -> report or retry; do not broadcast
|
+-- failure -> report or retry; do not broadcast
|
||||||
|
|
|
|
||||||
|
|||||||
@@ -208,9 +208,6 @@ function writeToStorage(value: Schema) {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
localStorage.setItem(BSKY_STORAGE, rawData)
|
localStorage.setItem(BSKY_STORAGE, rawData)
|
||||||
if (localStorage.getItem(BSKY_STORAGE) !== rawData) {
|
|
||||||
throw new Error('Failed to verify persisted state')
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('persisted state: failed writing root state to storage', {
|
logger.error('persisted state: failed writing root state to storage', {
|
||||||
message: error,
|
message: error,
|
||||||
|
|||||||
Reference in New Issue
Block a user