Skip to content

Conversation

@gribnoysup
Copy link
Collaborator

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

@gribnoysup gribnoysup requested a review from a team as a code owner July 21, 2025 15:01
@gribnoysup gribnoysup added the no release notes Fix or feature not for release notes label Jul 21, 2025
@github-actions github-actions bot added the fix label Jul 21, 2025
/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'/,
Copy link
Collaborator Author

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() {
Copy link
Collaborator Author

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

@gribnoysup gribnoysup requested a review from Anemy July 21, 2025 15:02
@gribnoysup gribnoysup changed the title fix(compass-web): adjust sandbox code for cloud backend and electron changes fix(compass-web): adjust sandbox code for cloud backend and electron changes COMPASS-9569 Jul 21, 2025
return {};
}

// When cloud session expires, cloud backend will send a new set of
Copy link
Collaborator Author

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

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

@gribnoysup gribnoysup merged commit e3a3ffd into main Jul 21, 2025
27 of 28 checks passed
@gribnoysup gribnoysup deleted the fix-atlas-cloud-sandbox-proxy branch July 21, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix no release notes Fix or feature not for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants