* ci(electron): verify packaged app.asar and smoke-test launch
Adds coverage for the gap that let #7320 ship: CI built electron TS
and ran electron-builder on release, but never exercised the packaged
binary. A stray relative import reaching out of electron/** was
compiled by tsc into src/app/util/*.js, fell outside the files glob
in electron-builder.yaml, and was missing from app.asar — the main
process crashed on launch for every 18.2.7 user.
Two new checks, both running on ubuntu-latest:
1. tools/verify-electron-requires.js extracts app.asar and re-resolves
every relative require() under electron/** against the packaged
tree. Runs on every PR that touches electron/**, electron-builder
config, package.json, or the workflow itself. ~10s after the build.
2. A launch-under-xvfb smoke test starts the packaged binary, waits
30s for a crash, and greps stderr for 'Cannot find module' /
'Uncaught Exception'. Runs on push to master, release tags, and
manual dispatch (not every PR — needs xvfb setup + idle wait).
Exposed as npm run electron:verify-asar for local use after dist.
* ci(electron): harden smoke workflow and verify script from review
Review feedback on the previous commit surfaced a handful of real
defects. Addressed here:
verify-electron-requires.js
- Guard resolved paths against escaping the extracted asar tree.
Without this, a relative require with enough `..` climbs above the
temp dir and Node's resolver hits the host filesystem, masking a
genuinely missing module behind a stray file on the CI runner.
- Walk .cjs and .mjs files too. electron/simple-store.test.cjs ships
via the `electron/**/*` glob and was being skipped.
- Move cleanup out of the path where `process.exit(1)` runs inside a
`try/finally` (synchronous exit does not guarantee `finally`), so
the temp dir is reliably removed.
- Code comment noting that esbuild-bundled preload.js is opaque to
this walker — that coverage comes from the launch smoke test.
electron-smoke.yml
- Broaden pull_request paths filter. The previous filter only matched
electron/**, which is exactly the wrong answer: #7320's root cause
was a file under src/app/util/ that electron/ imported. Now uses a
negative list — docs, translations, android/, ios/, other workflows.
- Explicit Xvfb screen geometry (`-screen 0 1280x720x24`) and
`--disable-dev-shm-usage` on the Electron side. Both known CI
flake preventers.
- Expanded crash-marker regex: SIGSEGV, Segmentation fault,
TypeError:, ReferenceError:, FATAL ERROR, Check failed. Also scan
the log during the liveness loop, not just at the end — catches
main-process exceptions that get logged without killing the
process.
- Move the launch log under .tmp/smoke/ so upload-artifact@v7 reliably
finds it on failure; /tmp paths are fragile across runner images.
- Sweep stray electron worker processes on teardown via pkill.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Address findings from code-reviewer + debugger-assistant +
refactor-specialist multi-review on 8e1c47ebc2:
- afterPack: read wrapper source before rename; on writeFile failure,
roll the rename back so a broken intermediate state can't ship a
package with no launcher. Strengthen idempotency check to require a
shebang at binPath (both files alone no longer counts as "installed").
- wrapper: gate the X11 injection on \$SNAP_NAME = "superproductivity",
not just \$SNAP set. An xdg-open from a sibling snap (e.g. Firefox)
leaks \$SNAP into the child env, which previously would have silently
forced XWayland on .deb/.rpm users. Derive BIN_DIR from \$SNAP
directly when we are our snap, avoiding fragile \$0 resolution
through snapd's wrapper chain. Stop argv scanning at -- so positional
args that resemble --ozone-platform aren't misread as a user override.
- app-control: point app.relaunch() execPath at the sibling shell
wrapper instead of the default process.execPath (which is the renamed
ELF and would bypass the flag injection on a relaunched Snap+Wayland
instance).
- Move build/snap-wrapper.sh -> build/linux/snap-wrapper.sh to match
the existing build/linux/ layout convention.
- Update research doc §18 to reflect the tightened predicate and the
relaunch fix.
Field reports on issue #7270 (v18.2.4 / v18.2.5) show that
app.commandLine.appendSwitch('ozone-platform','x11') is not equivalent
to the CLI flag on Snap+Wayland: Chromium's Ozone init dlopens
libEGL/libgbm on the core22 Mesa path before the switch is honored and
segfaults under host-vs-snap Mesa ABI drift, while the same flag on
argv consistently works.
Install an afterPack hook that renames the Electron binary and drops a
shell wrapper at the original name. The wrapper injects the flag into
argv only when \$SNAP is set AND the session is Wayland — non-Snap
targets (AppImage, .deb, .rpm) and X11 sessions pass through untouched.
Matches the mechanism used by snapcrafters/signal-desktop and
snapcrafters/mattermost-desktop.
See docs/research/snap-wayland-gpu-fix-research.md §18 for the full
evidence trail, drawbacks, validation plan, and removal conditions.
sharp is a native C++ module that fails to compile in F-Droid's
build environment. It is only used by manual icon generation scripts,
so auto-install it on demand instead.
Closes#6637
App-state selectors crashed during test teardown when the feature store
was unregistered. Lighthouse resource count budgets increased for the
new deadline feature chunks (scripts 170→200, total 220→250).
Group individual loadComponent routes into fewer lazy chunks:
- Tag + project sub-routes share one chunk via context.routes.ts
using loadChildren with static component imports
- Standalone pages share one chunk via pages.routes.ts barrel
re-export with loadComponent importing from same module
- Use canActivateChild for FocusOverlayOpenGuard so it re-fires
when navigating between child routes within the same context
Lighthouse resource budgets updated to match new chunk count.
Add --ensure flag to load-env.js that skips generation if
env.generated.ts already exists, allowing ng serve to work in
fresh worktrees without running npm run env first.
Also make load-env.js idempotent by comparing content before
writing and removing the timestamp from generated output.
The previous two-tag approach (`currentTag` → `prevTag`) would resolve the
wrong changelog range during `npm version` since the new tag doesn't exist
yet. Simplified to a single `lastTag...HEAD` range which correctly captures
all commits since the last release.
Added try-catch with fallback to last 20 commits when no tags exist, and
a fallback message for empty changelogs.
Remove the 15k-line auto-generated CHANGELOG.md and its conventional-changelog
tooling. The bump-android-version script now derives Play Store fastlane
changelogs from git log between tags instead of parsing CHANGELOG.md.
- Use execFileSync with argv to avoid shell injection
- Filter merge commits with --no-merges
- Handle breaking-change prefix (feat!:) in regex
- Truncate at line boundaries for 500-char Play Store limit
- Remove conventional-changelog-cli and @conventional-changelog/git-client deps
- Remove release.changelog script from package.json
Remove the flatten-with-white-background step from the icon generator.
macOS .icns natively supports PNG with alpha, so the flatten was
unnecessarily filling transparent areas outside the squircle mask
with white, causing visible borders in the Dock and Finder.
Split Sharp pipeline into two stages to fix edge pixel blending.
When chained directly, dest-in composite and flatten don't properly
preserve alpha channel data, causing edges to retain the original
icon color instead of blending with the white background.
Fixes#6323
Replace simple SVG rounded rect (circular arcs) with Apple's actual
continuous-corner shape reverse-engineered from UIBezierPath. This
produces the correct squircle with smooth curvature transitions.
- Add extract and merge modes to manage missing translations
- Implement functions to extract missing keys and merge WIP files
- Create usage documentation for the translation management script
The font budget was set to 260KB before the Material Icons to Material
Symbols upgrade. Material Symbols font is ~456KB, causing Lighthouse CI
to fail. Increase budget to 520KB to accommodate the larger font with
headroom for future updates.
iOS renders transparent pixels as white, causing a white frame around the
app icon. This fix generates a 1024x1024 RGB PNG (no alpha channel) from
the existing build/icons/sq2160x2160.png source.
Changes:
- Add tools/generate-ios-icon.js script using Sharp to resize and remove alpha
- Add npm script 'generate:ios-icon' for reproducible icon generation
- Update AppIcon-512@2x.png to RGB format (was RGBA)
- Install Sharp as dev dependency for image processing
Icon is now fully opaque with correct brand blue color and white checkmark.
- Update bump-android-version.js to handle RC/alpha/beta versions
- Pre-releases use versionCode suffix 0001-8999, stable uses 9000
- This ensures users can upgrade from RC to stable without uninstalling
- Skip Play Store upload for pre-release tags (GitHub only)
- Skip fastlane changelog generation for pre-releases
Fixes#5964
- Add getEnvOptional() method for accessing optional environment variables
- Separate REQUIRED_ENV_KEYS from OPTIONAL_ENV_KEYS in load-env.js
- Update UnsplashService to use getEnvOptional() instead of getEnv()
- ENV object now only contains actual values, not 'undefined' strings
- Cleaner separation between required and optional configuration
- Always read system environment variables first, then override with .env file
- Ensure all required keys are always present in generated types
- Pass environment variables correctly in Docker build
- Update .dockerignore to exclude build artifacts