Hover observables are never unsubscribed
Created by: sqs
Repro:
Create a hover provider in an extension like this:
sourcegraph.languages.registerHoverProvider(['*'], {
provideHover: () =>
interval(100).pipe(
map(n => ({
contents: { kind: sourcegraph.MarkupKind.Markdown, value: `⏱ ️${n}` },
}))
),
})
- Enable the extension.
- Turn on extension host communication trace logging by running
localStorage.debug=1;location.reload()
and then toggling it on in theExt
menu in the bottom right. - Hover over it in Sourcegraph. You will see the hover change frequently.
- Now hover away from it.
Notice that the JS devtools console shows that it is still sending messages with new hover contents. It should have been unsubscribed.
This is a resource leak and could make things slow. Not high priority since it's unlikely to cause many actual problems, but good to fix anyway.