Skip to content

fix: robustness leftovers of the release audit - #135

Merged
klNuno merged 12 commits into
mainfrom
fix/robustness-leftovers
Nov 22, 2026
Merged

klNuno merged 12 commits into
mainfrom
fix/robustness-leftovers

Conversation

@klNuno

@klNuno klNuno commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Note

Clanker Claude Opus 5.5 is responding on behalf of meetsu

Summary

Closes the robustness leftovers of the release audit.

What changes

  • Linux and macOS quit cleanly on SIGTERM and SIGINT. A self-pipe signal handler wakes the event loop with the same orderly quit as the Quit menu, so pending saves are flushed even with close-to-tray on.
  • Battle.net names owed to the saved-accounts list survive a restart. They move from memory into the machine-local config (owed_saved_accounts, skipped when empty, stripped from the portable config). A config without the field loads as before.
  • The mock backend is no longer compiled into release builds. accshift_app::mock sits behind cfg(test) or the mock feature, which the harness feature turns on.
  • The CLI no longer prints raw account ids after a switch or dry run. It prints the persona name, display name or BattleTag, and nothing when the account has no label (CodeQL rust/cleartext-logging).
  • Two ignored tests that waited for removed probe scripts are replaced by an active layout test at 100, 125 and 150 % scale.
  • Two load-sensitive tests are deterministic now: the unreachable-endpoint test keeps a bound listener that drops connections, and the external-restore test holds each storage step explicitly.

The CLI change covers the human-readable switch and dry-run headers. The JSON schema and the dry-run plan details are preserved.

Related issue

None.

Testing

  • build-safe node scripts/gates.mjs: exit 0 (fmt, clippy, 2046 Rust tests, worker, bundle, Stream Deck).
  • Both former load-sensitive tests: 20/20 passes each.
  • cargo check --release of accshift-app, accshift-egui (default and harness) and accshift-cli: exit 0.
  • Not run locally: the Unix signal tests (Windows host), they run in CI on Linux and macOS.

Tested on

  • Windows
  • macOS
  • Linux

Checklist

  • CI checks pass locally
  • Docs or wiki updated if the change is user-facing
  • No secrets, session tokens or captured account data in the diff

verified

  • build-safe node scripts/gates.mjs (short TEMP): exit 0 on 576b0ae.
  • Three targeted CLI, descriptor and Battle.net regression tests rerun on 576b0ae: 3 passed, 0 failed.
  • reviewed by GPT-6.2 Sol: 3 rounds, approved.
  • Pending verification: Unix signal delivery on CI and a full upgrade from the installed 2.0.0 release.

A setup cleared SavedAccountNames first and only then wrote the copy to
the local config, so a crash in between or a failed config write lost
the list. The copy is now saved first, and a setup whose copy cannot be
saved aborts before touching the launcher's list. When emptying the list
fails, the names it still holds are settled again.
- egui: a signal handler on another thread could load the pipe fd just
  before teardown closed it and then write into a reused fd. Handlers
  now count themselves in flight around the write, and teardown hides
  the fd, then waits for that count to reach zero before closing it.
- egui tests: commands held at the mock are released by a guard on
  drop, so a failed assertion fails the test instead of leaving a worker
  parked at the hold for Jobs::drop to join forever.
- cli: the switch label takes the account whose id matches exactly
  before one that only matches once folded, and folds ids only the way
  the platform's own switch does, so two ids that differ by case never
  swap labels.
… abort

- cli: the switch label uses the id the descriptor engine normalises the
  input to, and the dry-run label uses the plan's account id. Descriptor
  ids only match exactly, so ` ABC ` on a case-sensitive descriptor no
  longer takes the label of `abc`.
- battle-net: a setup that gives up after quitting the launcher starts
  it again if it was running, and still reports the setup's own error.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fceb7bad-c7ec-4255-be52-c0db45e0b6d3
Commits

Reviewing files that changed from the base of the PR and between d2fc9c9 and 0121502.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 32

  • crates/accshift-app/Cargo.toml
  • crates/accshift-app/src/accounts/profile_cache.rs
  • crates/accshift-app/src/lib.rs
  • crates/accshift-app/tests/lifecycle_updater.rs
  • crates/accshift-app/tests/mock_parity.rs
  • crates/accshift-cli/src/main.rs
  • crates/accshift-cli/src/output.rs
  • crates/accshift-core/src/config/mod.rs
  • crates/accshift-core/src/config/raw.rs
  • crates/accshift-core/src/config/split.rs
  • crates/accshift-core/src/config/tests.rs
  • crates/accshift-core/src/platforms/battle_net/mod.rs
  • crates/accshift-core/src/platforms/battle_net/setup.rs
  • crates/accshift-core/src/platforms/battle_net/tests.rs
  • crates/accshift-core/src/platforms/descriptor/engine/mod.rs
  • crates/accshift-core/src/platforms/descriptor/engine/tests.rs
  • crates/accshift-core/src/platforms/mod.rs
  • crates/accshift-egui/Cargo.toml
  • crates/accshift-egui/src/app/boot.rs
  • crates/accshift-egui/src/app/mod.rs
  • crates/accshift-egui/src/app/shortcuts.rs
  • crates/accshift-egui/src/app/tests/native_regressions.rs
  • crates/accshift-egui/src/app/updates.rs
  • crates/accshift-egui/src/app/wallpaper.rs
  • crates/accshift-egui/src/lib.rs
  • crates/accshift-egui/src/screens/primitives.rs
  • crates/accshift-egui/src/soft/events.rs
  • crates/accshift-egui/src/soft/mod.rs
  • crates/accshift-egui/src/ui/text/glyph_check.rs
  • crates/accshift-egui/src/ui/text/mod.rs
  • crates/accshift-egui/src/window/mod.rs
  • crates/accshift-egui/src/window/signal.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@mtsu-patrol mtsu-patrol Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

@mtsu-patrol

mtsu-patrol Bot commented Nov 22, 2026

Copy link
Copy Markdown

This pull request makes the app quit in an orderly way when Linux and macOS send a stop signal, and keeps Battle.net saved names owed to a later switch across a restart. It also hides raw account ids in readable command output, keeps the mock backend out of release builds, and replaces timing-sensitive tests with deterministic checks.

No comments posted: the reviewers raised no finding.

Review details
  • Model: muse-spark-1.3-contributor
  • Compared commits: d2fc9c9 to 0121502
  • Execution: tests could run in a disposable Linux sandbox
  • Files reviewed: 32 of 33
  • Duration: 5 min 9 s
Files skipped (1)
  • Cargo.lock: lockfile
Commands run (11)

Explored repo layout and gates (fmt, clippy, cargo test --workspace, worker tsc/vitest, bundle, streamdeck); confirmed no Rust toolchain, C compiler, or pkg-config in sandbox (node/npm/curl present, network OK). Downloaded rustup-init and zig 0.14.1 tarball (~49MB, valid XZ). Ran no Rust tests/build; could not reproduce or verify any PR behavior before budget expired.

passed · exit 0 · 0 s

ls -R | head -n 200; echo "---"; cat README.md 2>/dev/null | head -n 200; echo "==="; cat package.json 2>/dev/null | head -n 100; echo "==="; cat scripts/gates.mjs 2>/dev/null | head -n 200

passed · exit 0 · 0 s

cargo --version; rustc --version; ls crates/; cat crates/accshift-egui/Cargo.toml | head -n 80; cat crates/accshift-app/Cargo.toml | head -n 80

passed · exit 0 · 0 s

ls -la /usr/local/cargo/bin/ 2>&1 | head; ls -la ~/.cargo/bin/ 2>&1 | head; which rustup 2>&1; ls /opt/ 2>&1 | head -n 50; cat /etc/os-release | head; node --version 2>&1 | head; python3 --version 2>&1 | head
echo "---PATH---"; echo $PATH

passed · exit 0 · 0 s

ls / 2>&1; uname -a 2>&1; ls /usr/local/bin/ 2>&1 | head -n 100; ls /usr/local/lib/ 2>&1 | head -n 100; echo ---; env 2>&1 | head -n 50

failed · exit 127 · 0 s

ls /bin /usr/bin 2>&1 | head -n 100; echo ---; ls /etc/ 2>&1 | head -n 50; echo ---; curl --version 2>&1 | head; wget --version 2>&1 | head; tar --version 2>&1 | head; gcc --version 2>&1 | head; cc --version 2>&1 | head; ld --version 2>&1 | head
[earlier output omitted]
debconf-escape
debconf-set-selections
debconf-show
debian-distro-info
delpart
delv
df
dh_bash-completion
diff
diff3
dig
---
fonts
resolv.conf
ssl
---
curl 8.5.0 (x86_64-pc-linux-gnu) libcurl/8.5.0 OpenSSL/3.0.13 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 (+libidn2/2.3.7) libssh/0.10.6/openssl/zlib nghttp2/1.59.0 librtmp/2.3 OpenLDAP/2.6.10
Release-Date: 2023-12-06, security patched: 8.5.0-2ubuntu10.16
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd
GNU Wget 1.21.4 built on linux-gnu.

-cares +digest -gpgme +https +ipv6 +iri +large-file -metalink +nls 
+ntlm +opie +psl +ssl/openssl 

Wgetrc: 
    /etc/wgetrc (system)
Locale: 
    /usr/share/locale 
Compile: 
tar (GNU tar) 1.35
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
/bin/bash: line 1: gcc: command not found
/bin/bash: line 1: cc: command not found
/bin/bash: line 1: ld: command not found

passed · exit 0 · 0 s

id; echo ---; apt-get --version 2>&1 | head; ls /var/cache/apt/ 2>&1 | head; df -h 2>&1 | head -n 20; free -m 2>&1 | head

passed · exit 0 · 0 s

sudo -n true 2>&1; echo "sudo:$?"; su -c true 2>&1 | head; echo ---; ls -la /tmp/ 2>&1 | head -n 20; touch /tmp/wtest 2>&1 && echo tmp-writable; touch /usr/wtest 2>&1; echo "usr-touch:$?"; mkdir -p ~/tools 2>&1 && echo home-writable; echo ---; find / -maxdepth 4 -name "cargo" -o -name "rustc" 2>/dev/null | head; ls -la ~/ 2>&1 | head -n 30

passed · exit 0 · 0 s

ls /bin/ 2>&1; echo "===/usr/bin==="; ls /usr/bin/ 2>&1; echo "===apt==="; cat /etc/apt/sources.list 2>&1 | head -n 30; ls /etc/apt/sources.list.d/ 2>&1 | head; cat /etc/debian_version 2>&1; dpkg --version 2>&1 | head

passed · exit 0 · 0 s

ls /etc/apt/ 2>&1; echo "===apt-config==="; apt-config dump 2>&1 | head -n 40; echo "===lsb==="; lsb_release -a 2>&1 | head; cat /etc/lsb-release 2>&1 | head; echo "===df==="; df -h 2>&1; echo "===arch/libc==="; uname -m; ldd --version 2>&1 | head; ls /lib/x86_64-linux-gnu/libc* 2>&1 | head; echo "===net==="; curl -sI --max-time 10 https://static.rust-lang.org/ 2>&1 | head -n 10; echo "curl:$?"

failed · exit 2 · 0 s

cat /work/Cargo.toml 2>&1 | head -n 60; echo "===gates==="; head -n 80 /work/scripts/gates.mjs 2>&1; echo "===crates==="; ls /work/crates/ 2>&1; echo "===libs==="; ls /usr/lib/x86_64-linux-gnu/ 2>&1 | grep -iE "libX11\.|libwayland|libxcb\.|libfontconfig|libfreetype|libGL\.|libEGL|libxkbcommon|libasound|libgtk|libssl\.|libsqlite" | head -n 30; echo "===pkgconfig==="; ls /usr/bin/pkg* /usr/bin/*config* 2>&1 | head; ls /usr/lib/x86_64-linux-gnu/pkgconfig/ 2>&1 | head -n 20
[earlier output omitted]
// broken gate. The process exits non-zero when any gate failed. Nothing is
// piped: a gate's own exit code is the one reported.
//
// Cargo gets CARGO_BUILD_JOBS=4 unless the caller already set a value. The
// Worker type-check calls the compiler directly: `pnpm --dir server exec` can
// try to reinstall `server/node_modules` and die on
// ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY.
import { spawnSync } from "node:child_process";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";

const root = join(dirname(fileURLToPath(import.meta.url)), "..");
const node = JSON.stringify(process.execPath);

const GATES = [
  { name: "fmt", cmd: "cargo fmt --all --check" },
  { name: "clippy", cmd: "cargo clippy --workspace --all-targets --locked -- -D warnings" },
  { name: "rust", cmd: "cargo test --workspace --locked" },
  { name: "worker", cmd: `${node} node_modules/typescript/bin/tsc --noEmit`, cwd: "server" },
  { name: "worker-test", cmd: `${node} node_modules/vitest/vitest.mjs run`, cwd: "server" },
  { name: "bundle", cmd: `${node} --test crates/accshift-egui/bundle/linux-deps.test.mjs` },
  // Stream Deck plugin: parsing, links, CLI lookup, strings, and a start of
  // the built bundle against a fake Stream Deck. That start test needs
  // `pnpm --dir integrations/streamdeck install` (esbuild, the SDK); without
  // it the test is skipped, except on CI where it fails.
  { name: "streamdeck", cmd: `${node} --test "test/*.test.mjs"`, cwd: "integrations/streamdeck" },
];

function select(argv) {
  const known = new Set(GATES.map((g) => g.name));
  const skip = argv[0] === "--skip";
  const names = skip ? argv.slice(1) : argv;
  for (const name of names) {
    if (!known.has(name)) {
      console.error(`unknown gate "${name}", known: ${[...known].join(", ")}`);
      process.exit(2);
    }
  }
  if (names.length === 0) return GATES;
  return GATES.f

passed · exit 0 · 7 s

mkdir -p ~/.patrol-dl ~/tools && cd ~/.patrol-dl && curl -sSL -o rustup-init.sh https://sh.rustup.rs && echo RUSTUP_OK && curl -sSL -o zig.tar.xz https://ziglang.org/download/0.14.1/zig-x86_64-linux-0.14.1.tar.xz && echo ZIG_OK; ls -la ~/.patrol-dl/; file ~/.patrol-dl/zig.tar.xz 2>&1 || head -c 300 ~/.patrol-dl/zig.tar.xz | od -c | head -n 5

@klNuno
klNuno merged commit d94a7f2 into main Nov 22, 2026
9 checks passed
@klNuno
klNuno deleted the fix/robustness-leftovers branch November 22, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant