From e3bd98003c80deca762125ef9da76a34928f3614 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Wed, 8 Feb 2023 12:45:28 -0500 Subject: [PATCH 1/3] Fix prop name for button to enable e2ee (#641) --- packages/desktop-client/src/components/settings/Encryption.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/desktop-client/src/components/settings/Encryption.js b/packages/desktop-client/src/components/settings/Encryption.js index 720106d8c26..5d44764d3c4 100644 --- a/packages/desktop-client/src/components/settings/Encryption.js +++ b/packages/desktop-client/src/components/settings/Encryption.js @@ -36,7 +36,7 @@ export default function EncryptionSettings({ prefs, pushModal }) { ) : serverURL ? ( pushModal('create-encryption-key')}> Enable encryption… @@ -58,7 +58,7 @@ export default function EncryptionSettings({ prefs, pushModal }) { ) : ( - Enable encryption…}> + Enable encryption…}> End-to-end encryption is not available when running without a server. Budget files are always kept unencrypted locally, and From 8ac7d00befc030dc9ddfe4b9ebb0253ae22bc5c4 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Thu, 9 Feb 2023 14:21:49 -0500 Subject: [PATCH 2/3] Allow bypassing SharedArrayBuffer override (#644) * Allow bypassing SharedArrayBuffer override * Make an attempt to avoid merging budgets * Update FatalError.js * s/allowBuggyFallback/isSharedArrayBufferOverrideEnabled/ Co-Authored-By: Matiss Janis Aboltins <886567+MatissJanis@users.noreply.github.com> --------- Co-authored-by: Matiss Janis Aboltins <886567+MatissJanis@users.noreply.github.com> --- .../src/browser-preload.browser.js | 9 +++- packages/desktop-client/src/browser-server.js | 2 +- .../src/components/FatalError.js | 54 ++++++++++++++++++- .../loot-core/src/client/actions/budgets.js | 3 ++ 4 files changed, 64 insertions(+), 4 deletions(-) diff --git a/packages/desktop-client/src/browser-preload.browser.js b/packages/desktop-client/src/browser-preload.browser.js index 714ff4a8c78..5886a6b2c49 100644 --- a/packages/desktop-client/src/browser-preload.browser.js +++ b/packages/desktop-client/src/browser-preload.browser.js @@ -18,11 +18,18 @@ function createBackendWorker() { worker = new BackendWorker(); initSQLBackend(worker); + if (window.SharedArrayBuffer) { + localStorage.removeItem('SharedArrayBufferOverride'); + } + worker.postMessage({ type: 'init', version: ACTUAL_VERSION, isDev: IS_DEV, - hash: process.env.REACT_APP_BACKEND_WORKER_HASH + hash: process.env.REACT_APP_BACKEND_WORKER_HASH, + isSharedArrayBufferOverrideEnabled: localStorage.getItem( + 'SharedArrayBufferOverride' + ) }); if (IS_DEV || IS_PERF_BUILD) { diff --git a/packages/desktop-client/src/browser-server.js b/packages/desktop-client/src/browser-server.js index 98159b3dd8d..1093cd81909 100644 --- a/packages/desktop-client/src/browser-server.js +++ b/packages/desktop-client/src/browser-server.js @@ -10,7 +10,7 @@ self.addEventListener('message', e => { let version = msg.version; let hash = msg.hash; - if (!self.SharedArrayBuffer) { + if (!self.SharedArrayBuffer && !msg.isSharedArrayBufferOverrideEnabled) { self.postMessage({ type: 'app-init-failure', SharedArrayBufferMissing: true diff --git a/packages/desktop-client/src/components/FatalError.js b/packages/desktop-client/src/components/FatalError.js index 4c816ed0be9..32b7869fb6d 100644 --- a/packages/desktop-client/src/components/FatalError.js +++ b/packages/desktop-client/src/components/FatalError.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useState } from 'react'; import { View, @@ -10,6 +10,7 @@ import { Link, Button } from 'loot-design/src/components/common'; +import { Checkbox } from 'loot-design/src/components/forms'; import { colors } from 'loot-design/src/style'; class FatalError extends React.Component { @@ -38,7 +39,7 @@ class FatalError extends React.Component { our troubleshooting documentation {' '} - for more information. + to learn more. ); } else { @@ -140,3 +141,52 @@ class FatalError extends React.Component { } } export default FatalError; + +function SharedArrayBufferOverride() { + let [expanded, setExpanded] = useState(false); + let [understand, setUnderstand] = useState(false); + + return expanded ? ( + <> +

+ Actual uses SharedArrayBuffer to allow usage from multiple + tabs at once and to ensure correct behavior when switching files. While + it can run without access to SharedArrayBuffer, you may + encounter data loss or notice multiple budget files being merged with + each other. +

+ + + + ) : ( + setExpanded(true)} + style={{ + color: `inherit !important`, + marginLeft: 5, + border: 'none !important', + background: 'none !important', + padding: '0 !important', + textDecoration: 'underline !important', + boxShadow: 'none !important', + display: 'inline !important', + font: 'inherit !important' + }} + > + Advanced options + + ); +} diff --git a/packages/loot-core/src/client/actions/budgets.js b/packages/loot-core/src/client/actions/budgets.js index 675d25e49cd..ec395f950cc 100644 --- a/packages/loot-core/src/client/actions/budgets.js +++ b/packages/loot-core/src/client/actions/budgets.js @@ -119,6 +119,9 @@ export function closeBudget() { dispatch(setAppState({ loadingText: 'Closing...' })); await send('close-budget'); dispatch(setAppState({ loadingText: null })); + if (localStorage.getItem('SharedArrayBufferOverride')) { + location.reload(); + } } }; } From f75ff99114e93502693396ca1e3d1bc4a79ea723 Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins Date: Thu, 9 Feb 2023 20:28:54 +0000 Subject: [PATCH 3/3] :bookmark: (23.2.9) ability to ignore SharedArrayBuffer error (#645) --- packages/desktop-client/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/desktop-client/package.json b/packages/desktop-client/package.json index 44a6b6265fb..eeabcb89fe7 100644 --- a/packages/desktop-client/package.json +++ b/packages/desktop-client/package.json @@ -1,6 +1,6 @@ { "name": "@actual-app/web", - "version": "23.2.5", + "version": "23.2.9", "license": "MIT", "files": [ "build"