-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CB-5933 Connection state is not synchronized with other resources tri…
…ggering connection state (#3119) * CB-5933. Added event for disconnect datasource * CB-5933. Added to gql * CB-5933 adds handlers for disconnected/connected events * CB-5933. Rename topic * CB-5933. Rename topic * CB-5933. Added event for connect to database * СB-5933 adds ConnectionDisconnectEventHandler * CB-5933. Fixed typo * CB-5933 fixes disconnect handler + adds connect handler for connections * CB-5933 fix for connected event * СB-5933 marks outdated connected/disconnected connections on event handling * CB-5933 cleanup * CB-5933 pr fixes * CB-5933 pr fixes * CB-5933. Refactor after review --------- Co-authored-by: denis.sinelnikov <[email protected]> Co-authored-by: Evgenia <[email protected]>
- Loading branch information
1 parent
02e6b9c
commit 6830e34
Showing
6 changed files
with
103 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
webapp/packages/core-connections/src/ConnectionStateEventHandler.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2024 DBeaver Corp and others | ||
* | ||
* Licensed under the Apache License, Version 2.0. | ||
* you may not use this file except in compliance with the License. | ||
*/ | ||
import { injectable } from '@cloudbeaver/core-di'; | ||
import { type ISessionEvent, type SessionEventId, SessionEventSource, SessionEventTopic, TopicEventHandler } from '@cloudbeaver/core-root'; | ||
import type { WsDataSourceConnectEvent, WsDataSourceDisconnectEvent } from '@cloudbeaver/core-sdk'; | ||
|
||
export type IWsDataSourceDisconnectEvent = WsDataSourceDisconnectEvent; | ||
export type IWsDataSourceConnectEvent = WsDataSourceConnectEvent; | ||
|
||
type ConnectionStateEvent = IWsDataSourceConnectEvent | IWsDataSourceDisconnectEvent; | ||
|
||
@injectable() | ||
export class ConnectionStateEventHandler extends TopicEventHandler<ConnectionStateEvent, ISessionEvent, SessionEventId, SessionEventTopic> { | ||
constructor(sessionEventSource: SessionEventSource) { | ||
super(SessionEventTopic.CbDatasourceConnection, sessionEventSource); | ||
} | ||
|
||
map(event: any): ConnectionStateEvent { | ||
return event; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters