8000 [Bug]: [AudioWorklet] value of `globalThis` differs between first and second calls to the worklet. · Issue #41263 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Bug]: [AudioWorklet] value of globalThis differs between first and second calls to the worklet. #41263

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

Open
3 tasks done
rmnbrd opened this issue Feb 7, 2024 · 10 comments · May be fixed by #47244
Open
3 tasks done
Assignees
Labels
27-x-y 28-x-y 29-x-y 30-x-y 31-x-y bug 🪲 has-repro-repo Issue can be reproduced by cloning a git repo platform/macOS status/confirmed A maintainer reproduced the bug or agreed with the feature

Comments

@rmnbrd
Copy link
rmnbrd commented Feb 7, 2024

Preflight Checklist

Electron Version

27.0.0

What operating system are you using?

macOS

Operating System Version

macOS 14.3

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

26.6.8

Expected Behavior

The value of the globalThis variable, inside an AudioWorklet, is supposed to be stale.

Actual Behavior

Since v27.0.0, the value of globalThis is changing from the first to the second call to the AudioWorklet, only when nodeIntegrationInWorker is set to true.

You can find attached screenshots that will give you more context about this issue, as well as a fork of the electron-quick-start project with the changes to reproduce the issue easily.

The biggest side-effect of this bug is that we no longer have access to node env (like require etc ...)

Screenshot 2024-02-07 at 5 34 50 PM Screenshot 2024-02-07 at 5 34 01 PM

Testcase Gist URL

rmnbrd/electron-quick-start@master...rmnbrd:electron-quick-start:issue-globalThis-value

Additional Information

Reproduction steps:

  1. Checkout the branch (link just above),
  2. Run the electron-quick-start project,
  3. Click on the "Start AudioWorklet" button 2 times,
  4. The value of globalThis differs between the first and second call to the AudioWorklet.
@rmnbrd rmnbrd added the bug 🪲 label Feb 7, 2024
@mlaurencin mlaurencin added platform/macOS has-repro-repo Issue can be reproduced by cloning a git repo 27-x-y labels Feb 7, 2024
@kamalbennani
Copy link

Hi @mlaurencin @codebytere
This seems to be a regression and it's impacting our capability to upgrade to the latest version of electron as the nodeIntegrationInWorker = true doesn't work as intended.
Would you mind taking a look at it whenever you have some free time 🙇
We really appreciate it.

@codebytere codebytere added the status/confirmed A maintainer reproduced the bug or agreed with the feature label Feb 9, 2024
@rmnbrd
Copy link
Author
rmnbrd commented Feb 27, 2024

Hello @codebytere,
Have you had the chance to look into this issue?

Thanks in advance 🙇

@kamalbennani
Copy link

Hey @codebytere
Do you have any ETA on when to expect a fix for this?
Thanks

@rmnbrd
8000 Copy link
Author
rmnbrd commented Apr 10, 2024

Hello @codebytere,
Do you have news regarding this bug?

Thanks in advance 🙇

@codebytere
Copy link
Member

@rmnbrd good news! This was an upstream issue fixed in https://issues.chromium.org/issues/327027138. I can try to backport it but it's in versions v30.0.0-beta.1 and newer.

@codebytere
Copy link
Member

Fixed in #41889

@rmnbrd
Copy link
Author
rmnbrd commented Apr 30, 2024

Hello @codebytere,
We're a bit confused because we tested with versions 28.3.1, 29.3.1, 30.0.0-beta.1, 30.0.1 and the bug is still present:

Screenshot 2024-04-30 at 11 23 03 AM

@mlaurencin mlaurencin reopened this May 8, 2024
@github-project-automation github-project-automation bot moved this to 👀 Unsorted Items in 30-x-y May 8, 2024
@github-project-automation github-project-automation bot moved this to 👀 Unsorted Items in 31-x-y May 8, 2024
@VerteDinde VerteDinde moved this from 👀 Unsorted Items to 👍 Does Not Block Stable in 30-x-y May 8, 2024
@VerteDinde VerteDinde moved this from 👀 Unsorted Items to 👍 Does Not Block Stable in 31-x-y May 8, 2024
@rmnbrd
Copy link
Author
rmnbrd commented Jul 12, 2024

Hello @mlaurencin and @codebytere,

Do you have news to share regarding when that fix will be released?

Thanks 🙂

@q8B
Copy link
q8B commented Nov 4, 2024

I'm having the same issue; it works the first 4 times and doesn't work after that. Refreshing the renderer process will reset it for the next 4 tries

With nodeIntegrationInWorker set to false globalThis will always have the same value (AudioWorkletGlobalScope)

In electron 27.x.y, 28.x.y and 29.x.y it worked only the first time. Since electron 30 (up to the latest v34.0.0-alpha.6) it's working only the first 4 times

Gist here: https://gist.github.com/5a8ab93852ccb201057a9f3e813af47b

@codebytere
Copy link
Member

@codebytere codebytere linked a pull request May 23, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
27-x-y 28-x-y 29-x-y 30-x-y 31-x-y bug 🪲 has-repro-repo Issue can be reproduced by cloning a git repo platform/macOS status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects
No open projects
Status: 👍 Does Not Block Stable
Status: 👍 Does Not Block Stable
Development

Successfully merging a pull request may close this issue.

5 participants
0