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

[HOLD for payment 2022-10-26] [$250] Upgrade electron #11204

Closed
flodnv opened this issue Sep 22, 2022 · 29 comments
Closed

[HOLD for payment 2022-10-26] [$250] Upgrade electron #11204

flodnv opened this issue Sep 22, 2022 · 29 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@flodnv
Copy link
Contributor

flodnv commented Sep 22, 2022

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Problem

The version of electron in package.json is really outdated, and now has a vulnerability.

Solution

Let's update to the latest if possible, or at least to 18.3.12.

@flodnv flodnv added External Added to denote the issue can be worked on by a contributor Daily KSv2 labels Sep 22, 2022
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2022

Triggered auto assignment to @NicMendonca (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@flodnv flodnv changed the title Upgrade electron Upgrade electron package Sep 22, 2022
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2022

Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (External)

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 22, 2022
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2022

Triggered auto assignment to @puneetlath (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot changed the title Upgrade electron package [$250] Upgrade electron Sep 22, 2022
@NicMendonca
Copy link
Contributor

@smrutiparida
Copy link
Contributor

smrutiparida commented Sep 23, 2022

Proposal:

The Electron is upgraded to 20.2.0 locally without any breaking changes.

Screen Shot 2022-09-23 at 12 35 35

There are 3 breaking changes introduced in 20.2.0. They are

Breaking Changes

  1. Removed the skip-taskbar feature on Linux. #35156

Not used in the codebase

  1. Renderers are now sandboxed by default unless nodeIntegration: true or sandbox: false is specified. #35125

Since we don't initialize nodeIntegration in our main.js, we can continue to use BrowserWindow with new default values. Or else can initialize the default values for nodeIntegration and sandbox

`return app.whenReady()
    .then(() => {
        const browserWindow = new BrowserWindow({
            backgroundColor: '#FAFAFA',
            width: 1200,
            height: 900,
            webPreferences: {
                preload: `${__dirname}/contextBridge.js`,
                contextIsolation: true,
            },
            titleBarStyle: 'hidden',
            nodeIntegration: false,
            sandbox: true,
        });`
  1. Added safeguards when building native modules with nan. Use node-gyp >=8.4.0 and electron-rebuild >=3.2.9 for when rebuilding native modules. #35160

We already use the node-gyp 9.0.0 and do not use electron-rebuild

Screen Shot 2022-09-23 at 12 53 47

###Test suite result
Screen Shot 2022-09-23 at 14 23 01

The change should work. If we do not wish to upgrade to 20.0.0 then we can also do step wise upgrade to 18.3.6 easily.

@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2022

@puneetlath, @parasharrajat, @NicMendonca Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Sep 26, 2022
@flodnv
Copy link
Contributor Author

flodnv commented Sep 26, 2022

@parasharrajat thoughts on the proposal?

@parasharrajat
Copy link
Member

Reviewing...

@melvin-bot melvin-bot bot removed the Overdue label Sep 26, 2022
@parasharrajat
Copy link
Member

@smrutiparida Proposal looks good to me. It might be good to upgrade the electron-reloader as well.

cc: @flodnv

🎀 👀 🎀 C+ reviewed

@puneetlath
Copy link
Contributor

Proposal seems good to me too 👍🏾

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Help Wanted Apply this label when an issue is open to proposals by contributors Daily KSv2 labels Sep 27, 2022
@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2022

📣 @smrutiparida You have been assigned to this job by @puneetlath!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@smrutiparida
Copy link
Contributor

I have applied to this job on upwork now.

@roryabraham
Copy link
Contributor

Heads up! We just added live-reload to the main process of Electron on dev. Please make sure that we don't break that.

@melvin-bot melvin-bot bot added the Overdue label Oct 6, 2022
@parasharrajat
Copy link
Member

@NicMendonca Based on #11324 (comment), It seems @smrutiparida is still not hired on Upwork. Could you please check that? Thank you.

@melvin-bot melvin-bot bot removed the Overdue label Oct 6, 2022
@Luke9389
Copy link
Contributor

@puneetlath
Copy link
Contributor

Oh yeah. Thanks @Luke9389. Looks like we did that here: #11531

@NicMendonca let's go ahead and pay @smrutiparida and @parasharrajat out since they did the work. And then let's close this issue and the PR since they are no longer needed.

@parasharrajat
Copy link
Member

PR is trying to upgrade to v20 of electron.

@puneetlath
Copy link
Contributor

Ah, good point. It looks like we've been waiting for @smrutiparida for almost a week now to update their PR. If we don't hear back in the next day, let's just close this out, since the security hole has already been resolved.

@Luke9389
Copy link
Contributor

My two cents is that we should close this, because we've already dealt with the security problem. Now we're just upgrading for the sake of upgrading (which we generally don't do without a demonstration of some material benefit).

@puneetlath
Copy link
Contributor

That makes sense to me. @NicMendonca let's pay @smrutiparida and @parasharrajat out and close.

@flodnv
Copy link
Contributor Author

flodnv commented Oct 13, 2022

I think we should upgrade to 19.0.15...?
image

@roryabraham
Copy link
Contributor

Alternatively, let's just update to the latest stable release 21.0.1?

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 19, 2022
@melvin-bot melvin-bot bot changed the title [$250] Upgrade electron [HOLD for payment 2022-10-26] [$250] Upgrade electron Oct 19, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2022

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.17-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2022-10-26. 🎊

@puneetlath puneetlath added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 19, 2022
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 26, 2022
@NicMendonca
Copy link
Contributor

@smrutiparida paid!

@parasharrajat please accept the job offer when you get a sec. Thanks!

@parasharrajat
Copy link
Member

There is some issue on Upwork side, I will try to do it asap.

@NicMendonca
Copy link
Contributor

@parasharrajat I'll set this one to weekly too!

@NicMendonca NicMendonca added Weekly KSv2 and removed Daily KSv2 labels Oct 28, 2022
@puneetlath
Copy link
Contributor

Were we able to get the payment situation figured out?

@parasharrajat
Copy link
Member

I have accepted the offer.

@NicMendonca
Copy link
Contributor

@parasharrajat paid! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants