Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db0d81e78e |
No files matched your search
@@ -17,12 +17,13 @@
|
|||||||
// move it.
|
// move it.
|
||||||
// updateState(fn) read fresh, apply fn to that fresh record, write it
|
// updateState(fn) read fresh, apply fn to that fresh record, write it
|
||||||
// back — all holding the lock every write of the stored
|
// back — all holding the lock every write of the stored
|
||||||
// record takes, so no other write, by the background or a
|
// record takes, so no other write lands in between, by
|
||||||
// page, lands in between, and the read is one storage
|
// the background or by any page except a page in a
|
||||||
// round trip ahead of the write rather than a page
|
// Firefox private window (README, "Stored state and its
|
||||||
// lifetime ahead of it (which is what made the popup's
|
// version"). The read is one storage round trip ahead of
|
||||||
// saveState() need a per-field merge against a baseline
|
// the write rather than a page lifetime ahead of it
|
||||||
// at all).
|
// (which is what made the popup's saveState() need a
|
||||||
|
// per-field merge against a baseline at all).
|
||||||
//
|
//
|
||||||
// A handler that must both read and write therefore does its network work
|
// A handler that must both read and write therefore does its network work
|
||||||
// against a snapshot it owns, and applies the RESULT inside updateState().
|
// against a snapshot it owns, and applies the RESULT inside updateState().
|
||||||
@@ -72,7 +73,8 @@ async function updateStateOnce(mutate) {
|
|||||||
// src/shared/browserApi.js) is held from the read to the write: two
|
// src/shared/browserApi.js) is held from the read to the write: two
|
||||||
// background turns, or a turn and a page's save, never interleave
|
// background turns, or a turn and a page's save, never interleave
|
||||||
// (https://git.eeqj.de/sneak/AutistMask/issues/641). Every page's save waits
|
// (https://git.eeqj.de/sneak/AutistMask/issues/641). Every page's save waits
|
||||||
// while it is held.
|
// while it is held, except a page in a Firefox private window, which Firefox
|
||||||
|
// gives locks of its own (README, "Stored state and its version").
|
||||||
//
|
//
|
||||||
// `mutate` must also not call updateState() itself, directly or through
|
// `mutate` must also not call updateState() itself, directly or through
|
||||||
// anything it awaits: the inner turn waits for the lock the outer one holds,
|
// anything it awaits: the inner turn waits for the lock the outer one holds,
|
||||||
|
|||||||
+3
-1
@@ -572,7 +572,9 @@ function reportSaveFailure(err) {
|
|||||||
// Each save runs start to finish holding the lock every write of the stored
|
// Each save runs start to finish holding the lock every write of the stored
|
||||||
// record takes (withLock() in src/shared/browserApi.js), so no write by
|
// record takes (withLock() in src/shared/browserApi.js), so no write by
|
||||||
// another page or the background lands between its read and its write and is
|
// another page or the background lands between its read and its write and is
|
||||||
// lost (https://git.eeqj.de/sneak/AutistMask/issues/641).
|
// lost (https://git.eeqj.de/sneak/AutistMask/issues/641). A page in a Firefox
|
||||||
|
// private window is the exception: Firefox gives it locks of its own (README,
|
||||||
|
// "Stored state and its version").
|
||||||
//
|
//
|
||||||
// The same lock orders this page's own saves. showView() calls saveState() on
|
// The same lock orders this page's own saves. showView() calls saveState() on
|
||||||
// every navigation without awaiting it, so two saves from one page can be
|
// every navigation without awaiting it, so two saves from one page can be
|
||||||
|
|||||||
Reference in new issue
Block a user