From cba88e6e455656f9bd4b51f733ee99c2bb51c3fb Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Wed, 17 Apr 2024 02:03:06 +0200 Subject: [PATCH] Update electron to 30.0.0 --- .github/workflows/benchmark.yml | 2 +- .github/workflows/ci.yml | 10 +++++----- .github/workflows/danger.yml | 2 +- .github/workflows/stories.yml | 2 +- .nvmrc | 2 +- app/permissions.ts | 6 ++++++ package.json | 4 ++-- ts/scripts/fuse-electron.ts | 3 ++- yarn.lock | 8 ++++---- 9 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index dff14a89f57e..77f2feb8537f 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -30,7 +30,7 @@ jobs: - name: Setup node.js uses: actions/setup-node@v3 with: - node-version: '20.9.0' + node-version: '20.11.1' - name: Install global dependencies run: npm install -g yarn@1.22.10 npm@10.2.5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b09c46f3975a..3aa65ca85bb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '20.9.0' + node-version: '20.11.1' - run: npm install -g yarn@1.22.10 npm@10.2.5 - name: Cache Desktop node_modules @@ -78,7 +78,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '20.9.0' + node-version: '20.11.1' - run: npm install -g yarn@1.22.10 npm@10.2.5 @@ -130,7 +130,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '20.9.0' + node-version: '20.11.1' - run: sudo apt-get install xvfb - run: npm install -g yarn@1.22.10 npm@10.2.5 @@ -197,7 +197,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '20.9.0' + node-version: '20.11.1' - run: npm install -g yarn@1.22.10 npm@10.2.5 node-gyp@10.0.1 # Set things up so @nodert-win10-rs4 dependencies build properly @@ -306,7 +306,7 @@ jobs: - name: Setup node.js uses: actions/setup-node@v3 with: - node-version: '20.9.0' + node-version: '20.11.1' - name: Install global dependencies run: npm install -g yarn@1.22.10 npm@10.2.5 diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index 863987b82344..96af089095c0 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -15,7 +15,7 @@ jobs: fetch-depth: 0 # fetch all history - uses: actions/setup-node@v3 with: - node-version: '20.9.0' + node-version: '20.11.1' - run: npm install -g yarn@1.22.10 npm@10.2.5 - name: Cache danger node_modules id: cache-desktop-modules diff --git a/.github/workflows/stories.yml b/.github/workflows/stories.yml index 9c370e5fcaa7..75752d72abe7 100644 --- a/.github/workflows/stories.yml +++ b/.github/workflows/stories.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '20.9.0' + node-version: '20.11.1' cache: 'yarn' - name: Install global dependencies run: npm install -g yarn@1.22.10 npm@10.2.5 diff --git a/.nvmrc b/.nvmrc index f3f52b42d3da..2dbbe00e679a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20.9.0 +20.11.1 diff --git a/app/permissions.ts b/app/permissions.ts index 9f2a2711a04c..b6a446cfd0c9 100644 --- a/app/permissions.ts +++ b/app/permissions.ts @@ -31,6 +31,12 @@ function _createPermissionHandler( // We default 'media' permission to false, but the user can override that for // the microphone and camera. if (permission === 'media') { + // Pacifying typescript because it is always there for 'media' permission + if (!('mediaTypes' in details)) { + callback(false); + return; + } + if ( details.mediaTypes?.includes('audio') || details.mediaTypes?.includes('video') diff --git a/package.json b/package.json index 6cb350861423..4f39c8f66733 100644 --- a/package.json +++ b/package.json @@ -291,7 +291,7 @@ "csv-parse": "5.5.2", "danger": "11.1.2", "debug": "4.3.3", - "electron": "29.1.5", + "electron": "30.0.0", "electron-builder": "24.6.3", "electron-mocha": "12.2.0", "endanger": "7.0.4", @@ -354,7 +354,7 @@ "read-last-lines/mz/thenify-all/thenify": "3.3.1" }, "engines": { - "node": "20.9.0" + "node": "20.11.1" }, "build": { "appId": "org.whispersystems.signal-desktop", diff --git a/ts/scripts/fuse-electron.ts b/ts/scripts/fuse-electron.ts index 259b878628ed..b7172c148e1f 100644 --- a/ts/scripts/fuse-electron.ts +++ b/ts/scripts/fuse-electron.ts @@ -44,7 +44,8 @@ export async function afterPack({ // Disables the --inspect and --inspect-brk family of CLI options [FuseV1Options.EnableNodeCliInspectArguments]: enableInspectArguments, // Enables validation of the app.asar archive on macOS - [FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true, + [FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: + electronPlatformName === 'darwin', // Enforces that Electron will only load your app from "app.asar" instead of // its normal search paths [FuseV1Options.OnlyLoadAppFromAsar]: true, diff --git a/yarn.lock b/yarn.lock index dc31e48250b8..28dcb83a6d30 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9259,10 +9259,10 @@ electron-window@^0.8.0: dependencies: is-electron-renderer "^2.0.0" -electron@29.1.5: - version "29.1.5" - resolved "https://registry.yarnpkg.com/electron/-/electron-29.1.5.tgz#b745b4d201c1ac9f84d6aa034126288dde34d5a1" - integrity sha512-1uWGRw/ffA62lcrklxGUgVxVtOHojsg/nwsYr+/F9cVjipZJn8iPv/ABGIIexhmUqWcho8BqfTJ4osCBa29gBg== +electron@30.0.0: + version "30.0.0" + resolved "https://registry.yarnpkg.com/electron/-/electron-30.0.0.tgz#6b72a27dcc46759fac5f12e147ef64554e596391" + integrity sha512-GRwKphq/TUhSlb44OwSckXKl50f5OR/pm9MvF3rBLyqcxwfu7L11xejrZ0hDea1eKyCkzGd4B+cIqaQiDguPEA== dependencies: "@electron/get" "^2.0.0" "@types/node" "^20.9.0"