WebViewPanel onDidDispose() is not being called when user closes a tab

I am using the next version of Theia, with a Visual Studio Code Extension and I want to do some cleanup when a user closes an editor tab.
However, this handler is simply not being called when I run the plugin on Theia.

When my extension runs on Visual Studio Code, it works just fine.

Is there are alternate API I should hook to in the context of Theia?

Thanks for your advice.

[original thread by Dominique Rochefort]

[Dominique Rochefort]

Here is the reference to Visual Studio Code documentation: https://code.visualstudio.com/api/references/vscode-api#WebviewPanel

[Dominique Rochefort]

It is declared here in the Theia plugins API: https://github.com/eclipse-theia/theia/blob/master/packages/plugin-ext/src/plugin/webviews.ts#L221

@dominique-rochefort i’m looking into it. There was a refactoring to handle reconnections by the plugin system and it’s a regression. The PR will be today.

An issue to track: https://github.com/eclipse-theia/theia/issues/6288

the PR: https://github.com/eclipse-theia/theia/pull/6326

[Dominique Rochefort]

Thanks @anton-kosyakov ! Really appreciate it!