super-productivity/electron
Johannes Millan 7291f2fdc8
fix(backup): show the Windows Store backup path only when it exists (#9218)
* docs(sync): clarify multi-device token usage

* fix(backup): show Windows Store backup path only if it exists

Settings showed the MSIX-virtualized path unconditionally under
process.windowsStore, without ever checking it is there. On installs
where the package is not virtualized the backups sit in the real
AppData\Roaming, so the settings page advertised a folder that does not
exist and rendered a dead file:// link - for the backup feature, whose
whole point is being findable after a disaster (#9209).

AppData redirection is not a constant: it applies only to virtualized
packages, and since Windows 10 1903 the OS resolves it per file. That is
why #995 and #9209 report the exact opposite symptom and both are right.
Probe for the directory instead of assuming, and fall back to the path we
actually write to, which is correct in either case.

Closes #9209

* fix(backup): pin the Windows Store backup path with a regression test

Follow-up to the previous commit, addressing multi-agent review.

Move the display-path decision next to the constants it reads, as
getBackupDirForDisplay(). BACKUP_DIR_WINSTORE stops being exported, so
the rule "verify before displaying" is enforced by the only accessor
instead of being an honour-system note in a doc comment - which is the
shape the 2025 fix got wrong. backup.ts already imports existsSync, so
this costs no new import and matches getRelaunchExecPath in
ipc-handlers/app-control.ts.

Correct the doc comment: it claimed BACKUP_DIR_WINSTORE is never read,
while BACKUP_LOAD_DATA accepts it as an allow-listed read root fifty
lines below. Left as-is otherwise; narrowing a GHSA-x937-wf3j-88q3 guard
does not belong in a display-path fix.

Add electron/backup.test.cjs pinning both directions of the loop this
bug has already run once: Store + LocalCache present must show it (#995),
Store + LocalCache absent must fall back (#9209). Verified by sabotage -
restoring the unconditional path fails the #9209 case, deleting the probe
fails the #995 case, and each kills only its own test.

Document the two accepted shortcuts with their ceiling and upgrade path:
the hardcoded package family name (unverifiable from source, degrades
gracefully), and the stale LocalCache dir left by a virtualized to
full-trust flip.

* docs(backup): record how the hardcoded package family name was verified

Computed it from the shipped v18.15.1 AppxManifest: PublisherId is the
first 8 bytes of SHA-256 over the UTF-16LE Publisher string in base32
(digits + a-z minus i/l/o/u). CN=AC30A249-AFE7-4B23-AE54-A95B4FDF8928
yields ch45amy23cdv6, matching the constant exactly - so it has not
drifted, and the previous comment's claim that it cannot be verified was
too pessimistic: any release artifact re-checks it without Windows.

* docs: trim backup path comments and document the electron test harness

Cut the duplicated MSIX explanation across the two doc blocks (-7 lines)
while keeping the parts that stop this bug round-tripping a third time:
the per-file 1903 semantics, the #995/#9209 link, and both shortcuts'
ceilings.

Add npm run test:electron to AGENTS.md. It was absent, and the harness
is easy to miss because it uses electron/*.test.cjs while the rest of
the repo uses .spec.ts - which tsconfig.electron.json actively excludes,
so a spec dropped there silently never runs. Searching for the repo's
dominant convention turns up nothing and invites the conclusion that
main-process code is untestable; it is not.
2026-07-21 12:54:06 +02:00
..
assets/icons fix(electron): crisp, flicker-free Linux tray icon (#4905) (#8484) 2026-06-19 12:43:00 +02:00
ipc-handlers fix(backup): show the Windows Store backup path only when it exists (#9218) 2026-07-21 12:54:06 +02:00
scripts refactor(electron): bundle preload script with esbuild to support sandbox mode 2026-03-22 19:38:21 +01:00
shared-with-frontend fix(sync): defer LocalFile folder pick commit to settings Save (#9075) (#9085) 2026-07-16 19:11:02 +02:00
task-widget fix(electron): assert renderer IPC boundary at window creation (#9018) 2026-07-15 10:37:10 +02:00
wayland-idle-helper Add ext-idle-notify backend for Wayland idle detection (#7337) 2026-04-24 16:50:24 +02:00
app-control.test.cjs fix(electron): respect tray title settings #7823 (#8097) 2026-06-08 12:07:09 +02:00
backup.test.cjs fix(backup): show the Windows Store backup path only when it exists (#9218) 2026-07-21 12:54:06 +02:00
backup.ts fix(backup): show the Windows Store backup path only when it exists (#9218) 2026-07-21 12:54:06 +02:00
bundled-plugin-ids.test.cjs feat(plugins): allow uploaded nodeExecution behind consent gate (#8576) 2026-06-25 16:45:54 +02:00
clear-stale-idb-locks.ts Feat/to me it looks like there are lots of 60dd04 (#7280) 2026-04-20 12:04:38 +02:00
clipboard-image-handler.test.cjs fix(security): restrict renderer-supplied filesystem IPC paths (#8223) 2026-06-09 18:16:22 +02:00
clipboard-image-handler.ts fix(security): restrict renderer-supplied filesystem IPC paths (#8223) 2026-06-09 18:16:22 +02:00
common-const.test.cjs refactor(sync): remove unused error classes, dialog, and constructor-time logging (phase 1, #8325) (#8510) 2026-06-20 13:36:56 +02:00
common.const.ts fix(electron): restore custom title bar on GNOME-X11 (#8483) (#8485) 2026-06-19 12:42:44 +02:00
CONFIG.ts Increase ping interval and idle time in order to not waste CPU cycles. (#6227) 2026-01-28 15:37:50 +01:00
debug.ts refactor: rename overlay-indicator to task-widget 2026-03-30 22:00:47 +02:00
electronAPI.d.ts fix(sync): defer LocalFile folder pick commit to settings Save (#9075) (#9085) 2026-07-16 19:11:02 +02:00
error-handler-with-frontend-inform.ts fix(error-handling): prevent [object Object] from appearing in error messages 2026-01-02 15:40:14 +01:00
exec.test.cjs fix(electron): remove exec IPC to close GHSA-256q (#8669) 2026-07-01 17:55:35 +02:00
file-path-guard.test.cjs fix(security): restrict renderer-supplied filesystem IPC paths (#8223) 2026-06-09 18:16:22 +02:00
file-path-guard.ts fix(security): restrict renderer-supplied filesystem IPC paths (#8223) 2026-06-09 18:16:22 +02:00
full-screen-blocker.ts fix(electron): assert renderer IPC boundary at window creation (#9018) 2026-07-15 10:37:10 +02:00
gpu-startup-guard.ts fix(electron): add GPU startup guard for confined Linux packages 2026-04-20 18:35:31 +02:00
idle-time-handler.ts fix(electron): retry Wayland idle helper startup (#7527) 2026-05-10 22:35:33 +02:00
image-cache.test.cjs feat(electron): restore bmp/avif background image support 2026-06-10 17:04:26 +02:00
image-cache.ts feat(electron): restore bmp/avif background image support 2026-06-10 17:04:26 +02:00
indicator.test.cjs refactor(sync): remove unused error classes, dialog, and constructor-time logging (phase 1, #8325) (#8510) 2026-06-20 13:36:56 +02:00
indicator.ts fix(electron): crisp, flicker-free Linux tray icon (#4905) (#8484) 2026-06-19 12:43:00 +02:00
ipc-handler-wrapper.test.cjs fix(security): restrict renderer-supplied filesystem IPC paths (#8223) 2026-06-09 18:16:22 +02:00
ipc-handler-wrapper.ts fix(security): restrict renderer-supplied filesystem IPC paths (#8223) 2026-06-09 18:16:22 +02:00
ipc-handler.ts fix(electron): remove exec IPC to close GHSA-256q (#8669) 2026-07-01 17:55:35 +02:00
jira-capability.test.cjs fix(electron): gate Jira IPC behind a one-shot capability (#9008) 2026-07-14 21:02:27 +02:00
jira-capability.ts fix(electron): gate Jira IPC behind a one-shot capability (#9008) 2026-07-14 21:02:27 +02:00
jira-image-auth.ts fix(electron): gate Jira IPC behind a one-shot capability (#9008) 2026-07-14 21:02:27 +02:00
jira-ipc.test.cjs fix(electron): gate Jira IPC behind a one-shot capability (#9008) 2026-07-14 21:02:27 +02:00
jira.test.cjs fix(electron): gate Jira IPC behind a one-shot capability (#9008) 2026-07-14 21:02:27 +02:00
jira.ts fix(electron): gate Jira IPC behind a one-shot capability (#9008) 2026-07-14 21:02:27 +02:00
local-file-sync.test.cjs fix(sync): defer LocalFile folder pick commit to settings Save (#9075) (#9085) 2026-07-16 19:11:02 +02:00
local-file-sync.ts fix(sync): defer LocalFile folder pick commit to settings Save (#9075) (#9085) 2026-07-16 19:11:02 +02:00
local-rest-api.ts fix(local-rest-api): validate PATCH/create field value types (#8738) 2026-07-03 18:20:33 +02:00
lockscreen.ts fix(electron): restore macOS lock screen by correcting osascript quoting 2026-04-16 19:47:52 +02:00
main-window.ts fix(electron): assert renderer IPC boundary at window creation (#9018) 2026-07-15 10:37:10 +02:00
main.ts fix(electron): improve protocol URL handling and register URL scheme on Linux 2026-03-05 16:45:05 +01:00
navigation-guard.test.cjs fix(electron): lock in-window navigation to the app's loaded origin (#8230) 2026-06-09 22:34:15 +02:00
navigation-guard.ts fix(electron): lock in-window navigation to the app's loaded origin (#8230) 2026-06-09 22:34:15 +02:00
open-url.test.cjs fix(electron): open file:// URLs with special characters on Windows (#8695) (#8698) 2026-07-02 11:47:51 +02:00
open-url.ts fix(electron): open file:// URLs with special characters on Windows (#8695) (#8698) 2026-07-02 11:47:51 +02:00
plugin-node-consent-store.test.cjs feat(plugins): persist nodeExecution consent per plugin (#8512) (#8600) 2026-06-29 16:12:00 +02:00
plugin-node-consent-store.ts feat(plugins): persist nodeExecution consent per plugin (#8512) (#8600) 2026-06-29 16:12:00 +02:00
plugin-node-executor.test.cjs fix(plugins): spawn nodeExecution scripts via process.execPath so packaged apps work #8707 (#8708) 2026-07-02 15:05:57 +02:00
plugin-node-executor.ts fix(plugins): spawn nodeExecution scripts via process.execPath so packaged apps work #8707 (#8708) 2026-07-02 15:05:57 +02:00
plugin-oauth.ts feat(plugins): generic OAuth hooks for issue-provider plugins (#8546) 2026-06-30 14:11:00 +02:00
preload-api-capability.test.cjs fix(electron): gate Jira IPC behind a one-shot capability (#9008) 2026-07-14 21:02:27 +02:00
preload.ts fix(sync): defer LocalFile folder pick commit to settings Save (#9075) (#9085) 2026-07-16 19:11:02 +02:00
protocol-handler.test.cjs feat(electron): trigger global shortcuts via superproductivity:// URLs (#8645) 2026-06-30 17:22:30 +02:00
protocol-handler.ts feat(plainspace): Collaborate-on-Plainspace discovery + smoother connect (#8649) 2026-07-01 16:39:34 +02:00
proxy-agent.test.cjs fix(jira): honor no_proxy for electron requests #6324 (#8177) 2026-06-09 15:00:43 +02:00
proxy-agent.ts fix(jira): honor no_proxy for electron requests #6324 (#8177) 2026-06-09 15:00:43 +02:00
shared-state.ts fix: refactor tray handling to use shared state for task and countdown visibility 2025-11-28 18:53:00 +01:00
simple-store.test.cjs fix(electron): harden simple store writes (#7297) 2026-04-21 15:03:30 +02:00
simple-store.ts fix(electron): harden simple store writes (#7297) 2026-04-21 15:03:30 +02:00
start-app.ts fix(electron): use display name for Linux notifications (#8640) 2026-06-30 14:01:01 +02:00
sync-path-resolver.test.cjs feat(electron): add sync-path-resolver for renderer-supplied paths 2026-06-09 22:23:47 +02:00
sync-path-resolver.ts feat(electron): add sync-path-resolver for renderer-supplied paths 2026-06-09 22:23:47 +02:00
task-widget.test.cjs Feat/task widget global shortcut (#7099) 2026-06-09 16:11:16 +02:00
tsconfig.electron.json fix(keyboard): resolve macOS global shortcut layout mismatch (#8378) (#8381) 2026-06-17 12:57:47 +02:00
various-shared.test.cjs feat(electron): trigger global shortcuts via superproductivity:// URLs (#8645) 2026-06-30 17:22:30 +02:00
various-shared.ts feat(electron): trigger global shortcuts via superproductivity:// URLs (#8645) 2026-06-30 17:22:30 +02:00
web-preferences-guard.test.cjs fix(electron): assert renderer IPC boundary at window creation (#9018) 2026-07-15 10:37:10 +02:00
web-preferences-guard.ts fix(electron): assert renderer IPC boundary at window creation (#9018) 2026-07-15 10:37:10 +02:00