-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Disconnect client explicitly (#25)
Client wasn't actually getting disconnected when user clicked disconnect button. I have introduced proper disposal logic to dispose all DH services as part of clearing caches. ### Testing #### Test 1 - Start DH server - Connect to server from vscode - Disconnect via the status bar item - Should see "Disconnected from Deephaven server: ..." toast message - Kill server. - Should **not** see a new "Disconnected from Deephaven server..." toast message #### Test 2 - Start DH server - Connect to server from vscode - Kill server - Should see "Disconnected from Deephaven server..." toast message resolves #22
- Loading branch information
Showing
8 changed files
with
75 additions
and
22 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Disposable } from '../common'; | ||
|
||
/** | ||
* Typeguard to determine if given object has a `disposable` method. | ||
* @param maybeDisposable The object to check. | ||
* @returns `true` if the object has a `dispose` method, `false` otherwise. | ||
*/ | ||
export function isDisposable( | ||
maybeDisposable: unknown | ||
): maybeDisposable is Disposable { | ||
return ( | ||
maybeDisposable != null && | ||
typeof maybeDisposable === 'object' && | ||
'dispose' in maybeDisposable && | ||
typeof maybeDisposable.dispose === 'function' | ||
); | ||
} |