-
Notifications
You must be signed in to change notification settings - Fork 246
fix(compass-web): adjust sandbox code for cloud backend and electron changes COMPASS-9569 #7128
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
Conversation
| /Module not found.+?(mongo_crypt_v1.(dll|so|dylib)|@mongodb-js\/zstd|aws-crt|gcp-metadata)/, | ||
| // Optional, comes from emotion trying to (safely) use react apis that we | ||
| // don't have in React 17 | ||
| /export 'useInsertionEffect'/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by, was really noisy in webpack logs and we know it's okay to ignore
| return new URL(url, 'http://localhost').pathname.startsWith('/v2/'); | ||
| } | ||
|
|
||
| async #getCSRFHeaders() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by, we moved this logic to the client some time ago and forgot to remove this
| return {}; | ||
| } | ||
|
|
||
| // When cloud session expires, cloud backend will send a new set of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another drive-by, should make sure we're not logged out as often in sandbox
| const tld = CLOUD_CONFIG_VARIANTS === 'local' ? 'localhost' : 'mongodb.com'; | ||
| const cloudHostCookies = (await session.defaultSession.cookies.get({})) | ||
| .filter((cookie) => { | ||
| return cookie.domain?.endsWith(tld) ?? true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah TIL domain isn't always there https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Cookies#define_where_cookies_are_sent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah, yeah, I was mostly going off of types here, I think for proxy purposes it's easier to include the ones that don't have any value there just in case
Our compass-web with Atlas Cloud tests started failing consistently around July 14th and it took awhile to track the issue: seems like the scoping for the auth cookies changed at some point in the cloud backend and so the cookie filtering logic just stopped working (I was also kinda expecting the tld to include the subdomains, but I don't think that assumption was true)
The fix is to adjust the filtering to pick up everything that includes the cloud tld domain. At least locally it seems to fix issues for me