Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(extensions): Race condition in search subscription (#2478)
__Issue:__ The extension-search subscription (as well as potentially others) - had a race condition: if a long running subscription `s0` was kicked off, and then disposed/replaced with a newer, shorter-running subscription `s1`, if the search triggered by `s0` occurred after `s1`, it would replace `s1`'s results. __Defect:__ The 'mental model' for the subscription like `Isolinear.Sub.t(msg)` is that, when active, they can potentially dispatch `msg`'s arbitrarily. However, when they are disposed and not active, they should not trigger messages. There was a bug in isolinear - fixed in revery-ui/isolinear#14 - that meant, if a subscription held on to the `dispatch` in its `init` / `update` (which is common when you have a promise-based request) - it could still trigger a dispatch after it had been disposed. __Fix:__ Addressed in revery-ui/isolinear#14, but we could also remove a workaround that was used (a `Latch.t`) in places where it was particularly problematic.
- Loading branch information