Code views are not cleaned up anymore
Created by: felixfbecker
Some ViewResolvers return an element
for the CodeView that does not match the element found with the selector
. We currently store CodeView state in a Map keyed by element, so this means we never clean them up.
It seems like we cannot make the element always match what's found with the selector. Since we cannot run the ViewResolver for removed elements (they look at outside state), the only solution is using a Set
instead and checking if removedNode.contains(codeView.element)
for every CodeView.
See discussion in https://github.com/sourcegraph/sourcegraph/pull/3976