-
Notifications
You must be signed in to change notification settings - Fork 246
chore(compass-web): build devtools-connect into compass web COMPASS-9793 #7588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8b1de0a
e77b2d0
8e9bb44
e32c23b
de44e19
0db0040
f0602fa
eb0aba9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| export function hookLoggerToMongoLogWriter() {} | ||
| export function createMongoDBOIDCPlugin({ logger }: any) { | ||
| return { | ||
| mongoClientOptions: {}, | ||
| logger, | ||
| /* eslint-disable @typescript-eslint/require-await */ | ||
| serialize: async () => '', | ||
| destroy: () => {}, | ||
| }; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,8 +28,12 @@ class Socket extends Duplex { | |
| lookup?: ConnectionOptions['lookup']; | ||
| tls?: boolean; | ||
| }) { | ||
| // WS does not support callback lookup | ||
| if ((lookup?.length ?? 0) > 0) lookup = undefined; | ||
|
Comment on lines
+31
to
+32
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a little inconvenient that this synchronous for CompassWeb and async everywhere else even if it is returning a dummy value. Should we refactor to return the cluster info in a callback?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are deliberatly not defining this function in a way that would mess up with the original interface as in theory it should be still passed down and be callable by the internals that we don't control and behave in a way that is matching the net interface
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That totally makes sense. Should it throw then if it's given the interface it doesn't support? or more accurately invoke the given callback with an error? any callers will probably hang if we don't do something with it.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, we should probably make the implementation in the connection storage for web fully matching the interface and call a callback with an error |
||
|
|
||
| const { wsURL, ...atlasOptions } = | ||
| lookup?.() ?? ({} as { wsURL?: string; clusterName?: string }); | ||
|
|
||
| this._ws = new WebSocket(wsURL ?? '/ws-proxy'); | ||
| this._ws.binaryType = 'arraybuffer'; | ||
| this._ws.addEventListener( | ||
|
|
@@ -157,8 +161,6 @@ export { isIPv4, isIPv6 } from 'is-ip'; | |
| export const isIP = (input: string) => ipVersion(input) ?? 0; | ||
| export const createConnection = (options: { host: string; port: number }) => { | ||
| const socket = new Socket(); | ||
| setTimeout(() => { | ||
| socket.connect(options); | ||
| }); | ||
| socket.connect(options); | ||
|
Comment on lines
-160
to
+164
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was making an exception uncatchable by the try/catch wrapping connect(). The exception was momentary while I was debugging stuff so not a code path used in practice, but curious to know why we put this in a setTimeout? |
||
| return socket; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { resolveSrv, resolveTxt } from '../dns'; | ||
|
|
||
| export const wasNativelyLookedUp = () => false; | ||
| export const withNodeFallback = { | ||
| resolveSrv, | ||
| resolveTxt, | ||
| }; |
Uh oh!
There was an error while loading. Please reload this page.