Skip to content
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

[Bug]: app.relaunch loses args when execPath specified. #33686

Closed
3 tasks done
p120ph37 opened this issue Apr 8, 2022 · 3 comments · Fixed by #35108
Closed
3 tasks done

[Bug]: app.relaunch loses args when execPath specified. #33686

p120ph37 opened this issue Apr 8, 2022 · 3 comments · Fixed by #35108
Labels
18-x-y 19-x-y bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/all

Comments

@p120ph37
Copy link
Contributor

p120ph37 commented Apr 8, 2022

Preflight Checklist

Electron Version

18.0.1

What operating system are you using?

macOS

Operating System Version

10.14.6

What arch are you using?

x64

Last Known Working Electron version

17.0.0-alpha.3

Expected Behavior

When invoking app.relaunch and specifying both execPath and args, I expect the args to be passed to the new process.

Actual Behavior

The binary specified by execPath is spawned as a new process, but the args are not applied.

Testcase Gist URL

https://gist.github.com/p120ph37/98cf0fb13790feed702f3e90cbddfbf6

Additional Information

This bug was introduced in 17.0.0-alpha.4, and is present in all newer stable versions up to and including at least 19.0.0-alpha.1 Also note that app.relaunch() doesn't work at all from within Electron Fiddle, so to run this gist, you must launch Electron directly (e.g.: via npm start).

@mlaurencin mlaurencin added platform/macOS has-repro-gist Issue can be reproduced with code at https://gist.github.com/ 18-x-y 19-x-y labels Apr 19, 2022
@p120ph37
Copy link
Contributor Author

p120ph37 commented Apr 21, 2022

Just a note: this does not seem to be MacOS-specific. I've observed the same issue on Windows too at least. And it affects the release versions of 17 as well (it was introduced during the 17 alpha phase)

@dube116
Copy link

dube116 commented May 23, 2022

problem from this commit
1e37162
merged in
https://github.com/electron/electron/pull/31555/files
Short-circuit evaluation problem

@p120ph37
Copy link
Contributor Author

Makes sense. The similar changes in native_window.cc from that same commit appear to have also caused an issue which has already been fixed: #33025

p120ph37 added a commit to p120ph37/electron that referenced this issue Jul 25, 2022
Commit 1e37162 changed a bitwise-or operator to a boolean-or operator,
which altered the short-circuit behavior and skipped the side-effect
of populating the "args" variable.

This commit restores the original side-effect behavior, while still
using a boolean-or operator to keep the linter happy.

Addresses issue electron#33686
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
18-x-y 19-x-y bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/all
Projects
No open projects
Status: Doesn't Block Stable
Development

Successfully merging a pull request may close this issue.

4 participants