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

Add a cli parameter '--userDataArea` to set the Electron 'userData' path #13155

Merged
merged 3 commits into from
Dec 20, 2023

Conversation

tsmaeder
Copy link
Contributor

@tsmaeder tsmaeder commented Dec 5, 2023

This PR allows to set a non-default Electron userData path in order to allow two copies of Theia without concurrency issues related to shared localStorage etc.

Part of #13107

Contributed on behalf of STMicroelectronics

What it does

Adds the relevant cli parameter.

How to test

Run two instances of Theia with different user data areas and make sure webviews work in both instances and the there are no concurrency-related issues show up in the log.

Review checklist

Reminder for reviewers

Part of eclipse-theia#13107

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>
@tsmaeder tsmaeder requested a review from planger December 5, 2023 16:26
Copy link
Contributor

@planger planger left a comment

Choose a reason for hiding this comment

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

Thank you! Code makes sense and works fine. I just have two rather minor comments inline.

readonly cwd: string;
readonly secondInstance: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should transfer the type doc comments for secondInstance, as it may not be obvious what that means.

createYargs(argv, process.cwd())
.command('$0 [file]', false,
cmd => cmd
.option('userDataArea', {
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest using electronUserData to clarify that this is about the Electron user data, and not to confuse with the config location (.theia by default or defined by $THEIA_CONFIG_DIR). WDYT?

Signed-off-by: Thomas Mäder <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>
Copy link
Contributor

@planger planger left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me! 👍

@tsmaeder tsmaeder merged commit 3174343 into eclipse-theia:master Dec 20, 2023
14 checks passed
@vince-fugnitto vince-fugnitto added this to the 1.45.0 milestone Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants