Repository navigation
Commit bc724b8
committed
fix(webview): keep memory and storage agreeing when a re-key recovery write fails
The recovery path for a re-key that committed onto a dead view awaited its
compensating write unguarded. When that write rejected, the exception escaped
past the return at the end of the block and fell into the authorship clear that
follows the live-view check, so storage still held the entry under the temporary
name while memory claimed the authorship had been consumed, and the next launch
would not re-key it. The comment above the block promises best effort for the
storage write only; the code was not best-effort for memory, which is the
asymmetry the reviewer saw against the forward write, whose authorship is
cleared only after a successful write.
Catch the recovery write, undo the in-memory re-key alongside it, and leave the
authorship claimed so a later launch can still find the entry under the name its
author wrote it under.
What the measurement separates is the catch, not the rollback. With the case
alone against this head the write run rejects out of the queue and the case
fails (1 failed | 970 passed, 971 tests). With the catch present it passes (34
test files, 971 tests). With the catch present but rethrowing it fails the same
way as the head. Removing only the rollback leaves every assertion green,
because ContextProxy already restores its own cache when a state write fails, so
the rollback is kept for the ordering it guarantees rather than for a difference
this harness can observe.
Case: leaves the entry under the temporary id and keeps authorship when the
compensating re-key write also fails. Review row: database id 4477965171.1 parent 3dd0854 commit bc724b8
2 files changed
Lines changed: 57 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1123 | 1123 | | |
1124 | 1124 | | |
1125 | 1125 | | |
1126 | | - | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
1127 | 1137 | | |
1128 | 1138 | | |
1129 | 1139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6898 | 6898 | | |
6899 | 6899 | | |
6900 | 6900 | | |
| 6901 | + | |
| 6902 | + | |
| 6903 | + | |
| 6904 | + | |
| 6905 | + | |
| 6906 | + | |
| 6907 | + | |
| 6908 | + | |
| 6909 | + | |
| 6910 | + | |
| 6911 | + | |
| 6912 | + | |
| 6913 | + | |
| 6914 | + | |
| 6915 | + | |
| 6916 | + | |
| 6917 | + | |
| 6918 | + | |
| 6919 | + | |
| 6920 | + | |
| 6921 | + | |
| 6922 | + | |
| 6923 | + | |
| 6924 | + | |
| 6925 | + | |
| 6926 | + | |
| 6927 | + | |
| 6928 | + | |
| 6929 | + | |
| 6930 | + | |
| 6931 | + | |
| 6932 | + | |
| 6933 | + | |
| 6934 | + | |
| 6935 | + | |
| 6936 | + | |
| 6937 | + | |
| 6938 | + | |
| 6939 | + | |
| 6940 | + | |
| 6941 | + | |
| 6942 | + | |
| 6943 | + | |
| 6944 | + | |
| 6945 | + | |
| 6946 | + | |
6901 | 6947 | | |
6902 | 6948 | | |
6903 | 6949 | | |
| |||
0 commit comments