Skip to content

feat(bson-parsing): restrict web worker scope COMPASS-11128 - #892

Draft
mabaasit wants to merge 2 commits into
web-worker-parsingfrom
restrict-worker-scope
Draft

mabaasit wants to merge 2 commits into
web-worker-parsingfrom
restrict-worker-scope

Conversation

@mabaasit

@mabaasit mabaasit commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Description

COMPASS-11128

Open Questions

Checklist


Stack created with GitHub Stacks CLIGive Feedback 💬

@mabaasit
mabaasit requested review from a team as code owners September 21, 2026 08:51
@mabaasit
mabaasit requested review from LuciaHarcekova and removed request for a team September 21, 2026 08:51
@mabaasit
mabaasit added this pull request to stack #894 September 21, 2026 08:51
@mabaasit mabaasit changed the title feat(bson-parsin): restrict web worker scope feat(bson-parsing): restrict web worker scope Sep 21, 2026
// Used by this file.
'self',
'onmessage',
'postMessage',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Adding const { self, onmessage, postMessage } = globalThis; above this statement should remove this requirement, and we do want to avoid a situation where the "sandbox" could call postMessage()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that's much better and will clean this up

'parseInt',
'encodeURIComponent',
'decodeURIComponent',
'Buffer',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Buffer is a Node.js concept, do we need that?

'__defineSetter__',
'__lookupGetter__',
'__lookupSetter__',
'constructor',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Object.prototype.constructor is part of standard JS, why are we excluding that?

@mabaasit mabaasit changed the title feat(bson-parsing): restrict web worker scope feat(bson-parsing): restrict web worker scope COMPASS-11128 Sep 22, 2026
@mabaasit
mabaasit marked this pull request as draft September 22, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants