This repository was archived by the owner on Nov 25, 2021. It is now read-only.
fix: unsubscribe from actions and hover observable #102
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Continuation of #100
The code view was still possible to be re-shown after being hidden because the nested action and hover Observables were not unsubscribed from and could emit after the code view was unhoverified. This would happen on a page navigation, because the removed code view causes the text documents in the extension API to be updated, which causes the Observable returned by
getActions
to emit again.The test reproduces the problem by making
getActions
emit something.The fix is to use
takeUntil()
to only take from the actions and hover Observables until the code view is unsubscribed (we need to do this for the two higher-order Observables).Fixes https://github.com/sourcegraph/sourcegraph/issues/3108