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

fix: create userData on requestSingleInstanceLock() if needed #33559

Merged
merged 5 commits into from Apr 4, 2022

Conversation

deermichel
Copy link
Contributor

@deermichel deermichel commented Mar 31, 2022

Description of Change

Closes #33547.

Regression introduced by #30594. The patch removed the behavior of creating the userData folder if needed. Without it, the single instance lock cannot be aquired and app.requestSingleInstanceLock() incorrectly returns false on first start of the app.

This PR restores the behavior from Electron 15 and below (= before the refactor landed). Test to prevent future regressions added as well ☺️ .

cc @magom001 @miniak @rzhao271

Checklist

Release Notes

Notes: Fixed incorrect return value of app.requestSingleInstanceLock() when setting non-existent user data folder.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Mar 31, 2022
@deermichel deermichel force-pushed the deermichel/fix-singleinstance branch from 9327ee6 to 94494c7 Compare March 31, 2022 13:09
@deermichel deermichel force-pushed the deermichel/fix-singleinstance branch from 94494c7 to 701a76d Compare March 31, 2022 13:33
@deermichel deermichel added target/16-x-y semver/patch backwards-compatible bug fixes labels Mar 31, 2022
@deermichel deermichel marked this pull request as ready for review March 31, 2022 14:44
@deermichel deermichel requested review from a team as code owners March 31, 2022 14:44
@magom001
Copy link

/ok

Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

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

Thanks for catching this!

Left comments for minor improvements

spec-main/api-app-spec.ts Outdated Show resolved Hide resolved
spec/fixtures/api/singleton-userdata/main.js Outdated Show resolved Hide resolved
patches/chromium/process_singleton.patch Outdated Show resolved Hide resolved
@deermichel deermichel force-pushed the deermichel/fix-singleinstance branch from dfa9a71 to 5c80f29 Compare April 1, 2022 08:13
@deermichel deermichel force-pushed the deermichel/fix-singleinstance branch 3 times, most recently from 8bc94e1 to 480d479 Compare April 1, 2022 08:21
@deepak1556
Copy link
Member

@jkleinsc how to trigger linux and mac CI for PR from forks ?

@deermichel
Copy link
Contributor Author

(@deepak1556 it's not a fork, it's just the branch name)

@deermichel deermichel changed the title fix: create userDataDir on requestSingleInstanceLock() if needed fix: create userData on requestSingleInstanceLock() if needed Apr 1, 2022
@deepak1556
Copy link
Member

Sorry missed that, we still need to trigger the linux and mac CI for this branch, not sure why they are not run.

trop bot pushed a commit that referenced this pull request Apr 4, 2022
* test: use custom userData folder for requestSingleInstanceLock()

* update test

* prefix test folder path

* fix: create userDataDir on requestSingleInstanceLock() if needed

* Trigger Build
@trop
Copy link
Contributor

trop bot commented Apr 4, 2022

I have automatically backported this PR to "16-x-y", please check out #33590

@trop trop bot added the in-flight/16-x-y label Apr 4, 2022
@trop
Copy link
Contributor

trop bot commented Apr 4, 2022

I have automatically backported this PR to "17-x-y", please check out #33591

@trop trop bot removed the target/16-x-y label Apr 4, 2022
@trop
Copy link
Contributor

trop bot commented Apr 4, 2022

I have automatically backported this PR to "18-x-y", please check out #33592

@trop trop bot added the in-flight/17-x-y label Apr 4, 2022
@trop
Copy link
Contributor

trop bot commented Apr 4, 2022

I have automatically backported this PR to "19-x-y", please check out #33593

zcbenz pushed a commit that referenced this pull request Apr 4, 2022
…) (#33591)

* test: use custom userData folder for requestSingleInstanceLock()

* update test

* prefix test folder path

* fix: create userDataDir on requestSingleInstanceLock() if needed

* Trigger Build

Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
codebytere pushed a commit that referenced this pull request Apr 4, 2022
…) (#33592)

* test: use custom userData folder for requestSingleInstanceLock()

* update test

* prefix test folder path

* fix: create userDataDir on requestSingleInstanceLock() if needed

* Trigger Build

Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
zcbenz pushed a commit that referenced this pull request Apr 4, 2022
…) (#33593)

* test: use custom userData folder for requestSingleInstanceLock()

* update test

* prefix test folder path

* fix: create userDataDir on requestSingleInstanceLock() if needed

* Trigger Build

Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
@trop trop bot removed the in-flight/19-x-y label Apr 4, 2022
bavulapati pushed a commit to bavulapati/electron that referenced this pull request Apr 29, 2022
…tron#33559)

* test: use custom userData folder for requestSingleInstanceLock()

* update test

* prefix test folder path

* fix: create userDataDir on requestSingleInstanceLock() if needed

* Trigger Build
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
…tron#33559)

* test: use custom userData folder for requestSingleInstanceLock()

* update test

* prefix test folder path

* fix: create userDataDir on requestSingleInstanceLock() if needed

* Trigger Build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: app.requestSingleInstanceLock() returns false on first start
5 participants