You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a591a1e
Browse filesBrowse the repository at this point in the historyBrowse files
fix(webview): compensate a profile deletion that the mutation timeout cancels
Chaining the provider profile mutation queue to the running mutation removed the assumption the deletion path was written
against. Its catch block skipped compensation whenever the abort signal had fired, because under the old contract a later
queued mutation could already have written those stores and a rollback would have overwritten it. Nothing can run in between
any more, so skipping the rollback no longer protects anyone - it leaves a half-applied deletion behind: settings deleted
while the profile list and the shared selection still name the profile, or the list pruned while the selection and the view
pins keep pointing at it.
Compensation now always runs, and the three comments that described the superseded contract are corrected. The test that
pinned the old behaviour asserted the rollback never replayed; under the new contract it asserts the opposite, and a new
red-first test covers the earlier cancellation point, between the settings commit and the profile-list write.
// A cancelled (timed-out) deletion has already yielded its place in the queue: the next
2713
-
// mutation may have written these stores since, so replaying this operation's rollback
2714
-
// would overwrite IT. Stop at the cancellation point and report the partial state
2715
-
// instead of compensating.
2716
-
if(signal.aborted){
2717
-
this.log(
2718
-
`deleteProviderProfile: cancelled by the mutation timeout (${errorinstanceofError ? error.message : String(error)}); skipping compensation so it cannot overlap the next queued mutation. Durable state reflects the steps that had already landed.`,
2719
-
)
2720
-
throwerror
2721
-
}
2712
+
// A cancelled (timed-out) deletion still compensates. The queue is chained to this run,
2713
+
// so no later mutation can have written these stores in the meantime: holding the queue
2714
+
// until the run settles is exactly what makes the rollback safe again. Skipping it would
2715
+
// leave a half-applied deletion behind - settings gone while the profile list or the
2716
+
// selection still name the profile, or the list pruned while pins keep pointing at it.
2722
2717
2723
2718
// Compensate every store that already landed, each awaited on its own so one
2724
2719
// failing restore cannot skip the next one. The deletion simply did not happen:
0 commit comments