Skip to content

Commit

Permalink
fix(extensions): Race condition in search subscription (#2478)
Browse files Browse the repository at this point in the history
__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
bryphe authored Sep 24, 2020
1 parent cb8042b commit b6e2388
Show file tree
Hide file tree
Showing 15 changed files with 212 additions and 289 deletions.
50 changes: 25 additions & 25 deletions bench.esy.lock/index.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions esy.lock/index.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b6e2388

Please sign in to comment.