dbeaver/pro#6605 fix: reset filters on logout (#3675)

* dbeaver/pro#6605 fix: reset filters on logout

This commit adds onLogout handler in DataViewerTabService which disposes opened tabs on logout.

Previously we didn't handle that at all and model was persisted in the memory after logout. On next login, if there was any filters, we would try to send them to backend and got an error, because backend doesn't support initial requests(without resultId) with filters.

The main logic of a handler repeats the already existed onDisconnect handler logic, which was extracted to handleTabsCleanup method. The difference between handlers is only in a set of tabs(onLogout we dispose all of them, onDisconnect - only tabs of a selected connection) and ability to interrupt the process.

* Revert "dbeaver/pro#6605 fix: reset filters on logout"

This reverts commit d124b444c7.

* dbeaver/pro#6605 fix: add onLoad Handler to ObjectViewerTabService

* Update webapp/packages/plugin-object-viewer/src/ObjectViewerTabService.ts

Co-authored-by: Alexey Potsetsuev <wrouds@gmail.com>

---------

Co-authored-by: Alexey Potsetsuev <wrouds@gmail.com>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
This commit is contained in:
Sychev Andrey
2025-08-21 12:35:41 +08:00
committed by GitHub
co-authored by Alexey Potsetsuev Daria Marutkina
parent 31841b7720
commit a0944850b1
@@ -67,6 +67,7 @@ export class ObjectViewerTabService {
onSelect: this.selectObjectTab.bind(this),
onClose: this.closeObjectTab.bind(this),
canClose: this.canCloseObjectTab.bind(this),
onUnload: this.unloadObjectTab.bind(this),
extensions: [
projectProvider(this.getProject.bind(this)),
@@ -104,6 +105,11 @@ export class ObjectViewerTabService {
});
}
private async unloadObjectTab(tab: ITab<IObjectViewerTabState>) {
// TODO: we need to call unloadPages, but it's not implemented in the DBObjectPageService
await this.dbObjectPageService.closePages(tab);
}
isPageActive(tab: ITab<IObjectViewerTabState>, page: ObjectPage): boolean {
return tab.handlerState.pageId === page.key;
}