Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Conversation

ankur22
Copy link
Collaborator

@ankur22 ankur22 commented Jan 23, 2024

What?

Refactor the parsing of the options for the browserContext.waitForEvent API so that it is done outside the promise and therefore on the main goja thread.

Why?

This will help mitigate issues which can occur when trying to access the goja runtime from multiple goroutines, which can causes panics since the goja runtime is not thread safe.

Checklist

  • I have performed a self-review of my code
  • I have added tests for my changes
  • I have commented on my code, particularly in hard-to-understand areas

Related PR(s)/Issue(s)

Updates: #1187

This change moves the option parsing out of the promise for
browserContext.waitForEvent. The change will help mitigate the risk of
accessing the (non thread safe) goja runtime by multiple goroutines
and instead force the parse (and working with the goja runtime) in the
main goja thread.
@ankur22 ankur22 merged commit 65e6bd8 into main-next Jan 25, 2024
@ankur22 ankur22 deleted the refactor/waitForEvent branch January 25, 2024 10:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants