Skip to content

feat(accounts): unify launcher and Minecraft account ownership - #44

Open
xinvxueyuan wants to merge 6 commits into
mainfrom
feat/unified-users
Open

xinvxueyuan wants to merge 6 commits into
mainfrom
feat/unified-users

Conversation

@xinvxueyuan

@xinvxueyuan xinvxueyuan commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The existing Accounts panel now groups Minecraft accounts under local launcher accounts for the current device user. Users can switch launcher accounts, keep separate Minecraft profiles and selections, or play as a temporary offline player without signing in.

Motivation

The flat account list had no OS-user ownership or grouping. The same launcher data directory could show the same Minecraft records after another OS user or another machine opened it, even though the secrets did not travel with the directory.

Changes

  • Account schema: accounts.json uses schema_version: 4 and device_roots, keyed by the device-user digest. A root stores launcher_accounts, selected_launcher, and its own optional retired_credentials. Each launcher account has a UUID v4 id, name (null for the anonymous account), mc_accounts, and a nullable selected Minecraft ID. Each Minecraft record keeps its provider-qualified id, name, optional server and optional credential. IDs remain the Microsoft or offline profile UUID, or the Yggdrasil profile UUID plus its server identity.
  • Ownership: Storage derives a domain-separated SHA-256 digest from the current process's Windows token SID and registry MachineGuid, or effective UID and Linux /etc/machine-id (D-Bus machine ID if unavailable or invalid) or macOS IOPlatformUUID. Raw OS principals and machine IDs are not persisted or logged. Account requests cannot supply a root ID. Mutations, cached sessions, authentication attempts, cleanup, and saved-player launch resolution stay inside the current root and the explicitly addressed launcher account where applicable.
  • Identity fallback: The worker stores its account namespace and optional native digest in AXLauncher/device-users under the local user configuration directory, outside the portable data root. When machine identity lookup fails, it reuses the saved namespace or atomically creates one from a random installation ID. With the same OS principal, recovery binds the existing namespace to the native digest without switching accounts; a different native identity does not reuse the old binding. When no OS principal can be queried, the local profile directory supplies the scope. If neither a native identity nor a usable local configuration binding is available, the worker fails rather than changing identities each run.
  • Migration and secrets: First successful open of schema 1–3 atomically replaces the document under the existing account lock. It puts all Minecraft records and their valid selection in the current user's anonymous launcher account, retaining the original UUID keyring references and top-level and account-level extension fields. The root inherits the cleanup queue. An absent scope starts with an anonymous account and no Minecraft accounts; an unsupported or invalid document is not overwritten. A reference is a legacy UUID string or {"key":"<UUID v4>"} for a new entry keyed by <device digest>:<UUID> in the same system store. Inline tokens and passwords are not written.
  • Desktop: The Accounts panel adds a local launcher account picker and a creation field, then shows only that launcher's Minecraft entries. An empty list retains the temporary offline player. Microsoft, offline UUIDs, and third-party sign-in flows remain intact. Yggdrasil launch metadata, including skin domains, still travels to the same pinned authlib-injector; this PR does not add a separate skin UI, Modrinth OAuth, or an API worker.

Testing

  • Windows: cargo nextest run --locked -p axlauncher_storage -p axlauncher_accounts --test-threads 1 — 41 passed, including native lookup failure, restart, recovery, principal isolation, and concurrent initialization.
  • Windows: cargo nextest run --locked -p axlauncher_core -p axlauncher_frontend -p axlauncher_launch -p axlauncher_state -p axlauncher_policy_tests --test-threads 1 — 293 passed; 15 packaged-only tests skipped by design.
  • Windows: node scripts/desktop.ts exec cargo clippy --workspace --all-targets --all-features --locked -- -D warnings passed; node scripts/desktop.ts exec cargo nextest run --workspace --locked --test-threads 1 passed 595 tests; node scripts/desktop.ts smoke passed the 15 packaged-only tests. Builds and tests ran sequentially with CARGO_BUILD_JOBS=1, CARGO_INCREMENTAL=0 and one test thread.
  • cargo fmt --all --check, cargo shear, cargo deny check, prek run --all-files --stage pre-commit, pnpm install --frozen-lockfile, pnpm nojs, pnpm tsc, pnpm eslint, pnpm test:scripts (58 tests), pnpm file-length, tombi format --check, tombi lint, typos ., and reuse lint — passed.
  • pnpm architecture passed locally and in the Ubuntu CI lane. CI desktop Clippy, tests, and packaged smoke passed on Windows, Linux, and macOS. The Nix newest, legacy, and output checks also passed.
  • Native window interaction and live sign-in against real Microsoft/Yggdrasil accounts were not manually exercised; the tests use fixture accounts and mocked auth exchanges.

Breaking Changes

Pre-schema-4 versions cannot reopen migrated account data. Back up accounts.json before upgrade if rollback is needed; restoring the backup does not restore any subsequently retired system credentials. A flat file has no provable owner, so open an existing shared/portable directory first as the user who owns its credentials. After migration, another OS principal or machine gets its own empty anonymous account in the directory (if filesystem permissions permit); metadata inside the shared file is not encrypted. No re-login is required on the original machine and user when the corresponding system keyring entries still exist.

Related

No linked issue.

Bind saved accounts to the current device user and group Minecraft
identities under local launcher accounts. Migrate flat documents without
moving credentials, and scope sign-in, refresh, cleanup, and launch to
the account's owner.

Assisted-by: OpenAI Codex CLI 0.172.0
Acted-By: 新v学员 <xinvxueyuan@yeah.net>
Signed-off-by: 新v学员 <xinvxueyuan@yeah.net>
@sourcery-ai

sourcery-ai Bot commented Nov 28, 2026

Copy link
Copy Markdown

Sorry @xinvxueyuan, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 7 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@github-actions github-actions Bot added module: domain Domain identifiers and base types module: frontend State, layout and window wiring module: repository Build, tooling and CI module: storage Filesystem and cache primitives version: 0.1.0 Version a report or pull request belongs to status: unreviewed No maintainer has reviewed this yet labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Impact analysis

Note

Advisory only: the affected test list is broad by design and does not gate this pull request. A missing index fails the job instead of posting an empty result.

31 changed files · 18 source · 8 test · 5 other · 112 affected test files

codegraph status: 399 files · 7118 nodes · javascript, nix, rust, typescript, yaml

Changed files

  • other: .agents/docs/crates.md
  • other: .agents/docs/filesystem-paths.md
  • other: Cargo.lock
  • other: REUSE.toml
  • source: apps/core/lib/accounts/src/accounts.rs
  • source: apps/core/lib/accounts/src/accounts/document.rs
  • source: apps/core/lib/accounts/src/accounts/hierarchy.rs
  • source: apps/core/lib/accounts/src/accounts/sessions.rs
  • source: apps/core/lib/accounts/src/accounts/sessions/persistence.rs
  • source: apps/core/lib/accounts/src/worker.rs
  • source: apps/core/lib/accounts/src/worker/login.rs
  • source: apps/core/lib/src/account_client.rs
  • source: apps/core/lib/src/accounts.rs
  • source: apps/core/src/desktop.rs
  • source: apps/core/src/desktop/launching.rs
  • other: apps/core/storage/Cargo.toml
  • source: apps/core/storage/src/atomic_file.rs
  • source: apps/core/storage/src/device_user.rs
  • source: apps/core/storage/src/lib.rs
  • source: apps/frontend/src/panel/accounts.rs
  • source: apps/frontend/src/panel/accounts/login.rs
  • source: apps/frontend/src/panel/accounts/render.rs
  • source: apps/frontend/src/panel/accounts/third_party.rs
  • test: tests/apps/core/lib/accounts/src/accounts/sessions.rs
  • test: tests/apps/core/lib/accounts/src/accounts/sessions/hierarchy.rs
  • test: tests/apps/core/lib/accounts/src/accounts/yggdrasil.rs
  • test: tests/apps/core/lib/accounts/src/worker.rs
  • test: tests/apps/core/src/desktop/launching.rs
  • test: tests/apps/core/storage/src/device_user.rs
  • test: tests/apps/frontend/src/panel/accounts.rs
  • test: tests/tests/embedded_workers.rs

Affected tests

CodeGraph followed imports 5 steps deep from the changed sources with codegraph affected.

Mirrors (apps/frontend/)

  • tests/apps/frontend/src/installations.rs
  • tests/apps/frontend/src/modpacks/service.rs
  • tests/apps/frontend/src/modpacks/service/acquisition.rs
  • tests/apps/frontend/src/panel/accounts.rs
  • tests/apps/frontend/src/panel/download_debug.rs
  • tests/apps/frontend/src/panel/download_debug/batch.rs
  • tests/apps/frontend/src/panel/instances.rs
  • tests/apps/frontend/src/panel/instances/launch.rs
  • tests/apps/frontend/src/panel/java/mod.rs
  • tests/apps/frontend/src/panel/profile_creation.rs
  • … 1 more in this group

Mirrors (apps/core/)

  • tests/apps/core/src/desktop/installation.rs
  • tests/apps/core/src/desktop/instance_settings.rs
  • tests/apps/core/src/desktop/java.rs
  • tests/apps/core/src/desktop/launching.rs
  • tests/apps/core/src/desktop/sources.rs

Mirrors (apps/core/lib/accounts/)

  • tests/apps/core/lib/accounts/src/accounts/sessions.rs
  • tests/apps/core/lib/accounts/src/accounts/sessions/hierarchy.rs
  • tests/apps/core/lib/accounts/src/accounts/yggdrasil.rs
  • tests/apps/core/lib/accounts/src/worker.rs

Mirrors (apps/core/lib/)

  • tests/apps/core/lib/src/bootstrap.rs
  • tests/apps/core/lib/src/java_discovery.rs
  • tests/apps/core/lib/src/settings_client.rs

Mirrors (apps/core/storage/)

  • tests/apps/core/storage/src/atomic_file.rs
  • tests/apps/core/storage/src/device_user.rs
  • tests/apps/core/storage/src/lib.rs

Dependent tests (apps/core/launch)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/launch/src/arguments.rs
  • tests/apps/core/launch/src/chain.rs
  • tests/apps/core/launch/src/chain/document_tests.rs
  • tests/apps/core/launch/src/classpath.rs
  • tests/apps/core/launch/src/classpath/tool_shadow_tests.rs
  • tests/apps/core/launch/src/flow/account_tests.rs
  • tests/apps/core/launch/src/flow/language_tests.rs
  • tests/apps/core/launch/src/flow/tests.rs
  • tests/apps/core/launch/src/flow/version_id_tests.rs
  • tests/apps/core/launch/src/jar.rs
  • … 13 more in this group

Dependent tests (apps/core/lib/installation)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/lib/installation/src/loader.rs
  • tests/apps/core/lib/installation/src/loader/lifecycle.rs
  • tests/apps/core/lib/installation/src/prepare.rs
  • tests/apps/core/lib/installation/src/processors.rs
  • tests/apps/core/lib/installation/src/processors/templates.rs
  • tests/apps/core/lib/installation/src/runtime.rs
  • tests/apps/core/lib/installation/src/runtime/record.rs
  • tests/apps/core/lib/installation/src/vanilla.rs
  • tests/apps/core/lib/installation/tests/processor_fixture.rs
  • tests/apps/core/lib/installation/tests/stand_in.rs

Dependent tests (tests/tests)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/tests/comment_policy.rs
  • tests/tests/crate_boundaries.rs
  • tests/tests/embedded_workers.rs
  • tests/tests/external_formats.rs
  • tests/tests/filesystem_paths.rs
  • tests/tests/port_errors.rs
  • tests/tests/spi_contract.rs
  • tests/tests/unsafe_boundaries.rs

Dependent tests (apps/core/state)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/state/src/files.rs
  • tests/apps/core/state/src/javas.rs
  • tests/apps/core/state/src/jobs.rs
  • tests/apps/core/state/src/profile.rs
  • tests/apps/core/state/src/profile/discovery.rs
  • tests/apps/core/state/src/profile/resources.rs
  • tests/apps/core/state/src/profile/update.rs
  • tests/apps/core/state/src/settings.rs

Dependent tests (apps/core/lib/download_engine)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/lib/download_engine/src/lib.rs
  • tests/apps/core/lib/download_engine/src/lib/range_identity.rs
  • tests/apps/core/lib/download_engine/src/lib/range_recovery.rs
  • tests/apps/core/lib/download_engine/src/lib/retry_tests.rs
  • tests/apps/core/lib/download_engine/src/streaming.rs
  • tests/apps/core/lib/download_engine/src/weighted.rs

Dependent tests (apps/core/network)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/network/src/auth.rs
  • tests/apps/core/network/src/auth/callback.rs
  • tests/apps/core/network/src/dns.rs
  • tests/apps/core/network/src/lib.rs
  • tests/apps/core/network/src/mirrors.rs
  • tests/apps/core/network/src/transfer.rs

Dependent tests (apps/core/loader)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/loader/src/forge.rs
  • tests/apps/core/loader/src/installer.rs
  • tests/apps/core/loader/src/installer/forge_inline.rs
  • tests/apps/core/loader/src/lib.rs
  • tests/apps/core/loader/src/neoforge.rs

Dependent tests (apps/core/mc_version)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/mc_version/src/java.rs
  • tests/apps/core/mc_version/src/maven.rs
  • tests/apps/core/mc_version/src/maven/order.rs

Dependent tests (apps/plugins/modpack)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/plugins/modpack/src/curseforge.rs
  • tests/apps/plugins/modpack/src/lib.rs
  • tests/apps/plugins/modpack/src/multimc.rs

Dependent tests (tests/tests/embedded_workers)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/tests/embedded_workers/installation.rs
  • tests/tests/embedded_workers/java_discovery.rs
  • tests/tests/embedded_workers/settings.rs

Dependent tests (apps/core/lib/java_discovery)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/lib/java_discovery/src/scan.rs
  • tests/apps/core/lib/java_discovery/src/windows.rs

Dependent tests (apps/core/spi)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/spi/src/loader.rs
  • tests/apps/core/spi/src/mc_version.rs

Dependent tests (apps/core/domain)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/domain/src/lib.rs

Dependent tests (apps/core/lib/instance_settings)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/lib/instance_settings/src/lib.rs

Dependent tests (apps/core/spi/network)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/spi/network/src/lib.rs

Dependent tests (apps/core/install)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/install/src/assets/tests.rs

Dependent tests (tests/tests/filesystem_paths)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/tests/filesystem_paths/rules.rs

Dependent tests (tests/tools/mmc-convert/src)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/tools/mmc-convert/src/patches.rs

Dependent tests (apps/core/storage/layout)

Reached through dependencies of the changed code rather than through a mirrored test file in this crate.

  • tests/apps/core/storage/layout/src/paths.rs

Import cycles

Touched 1 import cycle group containing 5 distinct files:

  • apps/core/lib/accounts/src/accounts.rs, apps/core/lib/accounts/src/accounts/document.rs, apps/core/lib/accounts/src/accounts/hierarchy.rs, apps/core/lib/accounts/src/accounts/sessions.rs, apps/core/lib/accounts/src/accounts/sign_in.rs

Analyzed 07099f395530..48c595e3197e with codegraph@1.6.4.

The full report is attached to this run as the pr-impact artifact.

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Scope Minecraft accounts to device users and local launcher accounts

✨ Enhancement 🐞 Bug fix 🕐 40+ Minutes

Grey Divider

AI Description

• Group Minecraft profiles and selections under local launcher accounts scoped to the current device
 user.
• Migrate flat account files without moving credentials, and isolate sign-in, cleanup, and launch
 resolution.
• Add launcher switching while preserving saved offline players and temporary play.
Merge Risk 🟡 Medium

Blast radius 🟡 Medium 💥 3 capabilities

  • 3 affected capabilities within one bounded functional scope: launcher account integration.
  • The device-user resolver, account document, hierarchy validation, worker snapshot, and frontend launcher picker jointly implement one bounded launcher-account behavior; the storage and UI hops are not independent capabilities.
  • Authentication, credential-store persistence, refresh, retirement, and launch resolution produce one end-to-end saved-account session behavior; the worker and UI are callers and consumers of that behavior.
  • The UI selection, worker command contract, account service lookup, and game launch resolution all implement the same user-visible outcome: launching Minecraft as the selected account within the selected launcher account.
Behavioral complexity 🔴 High 🧩 Multiple interactions

  • Before, one flat account list and one selection were read and written directly.
  • After, device identity selects a root, schema migration creates launcher roots, and each hierarchy must preserve unique launchers, one anonymous launcher, valid selections, account uniqueness, and credential uniqueness.
  • New correctness conditions include principal binding, old/new document compatibility, migration idempotence, and coordinated launcher/account selection updates.
Potential damage 🟡 Medium 🩹 Temporary loss

  • A wrong principal, invalid migration, or hierarchy invariant failure can hide or reject saved accounts and prevent account selection.
  • The stored document remains available for forward migration or manual repair, but a base-version rollback cannot read schema 4 without conversion.
  • Account visibility can generally be restored by using the correct principal, completing forward migration, or repairing the document; rollback requires state conversion.
Assessed commit 48c595e
Diagram

graph TD
  PANEL["Accounts panel"] --> WORKER["Account worker"] --> SERVICE["Account service"] --> FILE["Account file"] --> ROOT["Launcher hierarchy"]
  UID["Device digest"] --> FILE
  SERVICE --> KEYRING["System keyring"]
  PANEL --> LAUNCH["Launch flow"] --> WORKER
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Separate account file per device user
  • ➕ Keeps other users' account metadata out of each user's document.
  • ➕ Avoids rewriting unrelated roots during an account change.
  • ➖ Requires a different storage layout and migration path.
  • ➖ Makes shared-directory behavior and existing file locking more complicated.

Recommendation: The schema-4 multi-root document is a reasonable fit for the existing managed account file and atomic migration. Reviewers should note its deliberate limit: root scoping prevents cross-user account operations, but does not encrypt metadata in a shared directory.

Files changed (27) +1894 / -590

Enhancement (13) +1099 / -307
accounts.rsDefine Minecraft records and credential references +42/-142

Define Minecraft records and credential references

• Renames the persisted Minecraft record, preserves account-level extension fields, and distinguishes legacy from device-scoped credential references. Adds ownership and hierarchy errors while moving document logic into dedicated modules.

apps/core/lib/accounts/src/accounts.rs

document.rsMigrate and transact schema-4 account files +176/-0

Migrate and transact schema-4 account files

• Introduces locked, atomic access to the current device user's root while retaining other roots. Migrates schemas 1–3 into an anonymous launcher account without changing legacy credential references or discarding extension fields.

apps/core/lib/accounts/src/accounts/document.rs

hierarchy.rsModel device roots and local launcher ownership +266/-0

Model device roots and local launcher ownership

• Adds anonymous and named launcher accounts with independent Minecraft lists and selections. Validates references and provides launcher-scoped account operations and credential retirement.

apps/core/lib/accounts/src/accounts/hierarchy.rs

worker.rsHandle launcher-qualified account requests +45/-32

Handle launcher-qualified account requests

• Routes launcher creation, selection, sign-in, and account changes to the scoped service. Resolves saved offline identities through the worker rather than treating them as temporary players.

apps/core/lib/accounts/src/worker.rs

account_client.rsResolve saved accounts using qualified keys +3/-3

Resolve saved accounts using qualified keys

• Changes the desktop account client to send a launcher-qualified account key for identity resolution.

apps/core/lib/src/account_client.rs

accounts.rsExpose launcher-aware account protocol types +100/-7

Expose launcher-aware account protocol types

• Adds launcher identifiers, qualified account keys, launcher summaries, and active-launcher snapshot data. Updates worker commands so mutations, authentication, and resolution address a launcher explicitly.

apps/core/lib/src/accounts.rs

desktop.rsExport launcher-aware desktop account types +2/-2

Export launcher-aware desktop account types

• Re-exports launcher summaries, launcher IDs, and qualified account keys for desktop consumers.

apps/core/src/desktop.rs

device_user.rsDerive a pseudonymous device-user identifier +105/-0

Derive a pseudonymous device-user identifier

• Hashes the current process principal and platform machine ID into a domain-separated identifier. Supports Windows, Linux, and macOS without persisting the raw identifiers.

apps/core/storage/src/device_user.rs

lib.rsExpose device-user identity to account storage +2/-0

Expose device-user identity to account storage

• Exports the device-user identifier used to select an account root.

apps/core/storage/src/lib.rs

accounts.rsManage local launcher forms and scoped players +110/-31

Manage local launcher forms and scoped players

• Adds local launcher creation state and keeps offline-account creation tied to its launcher. Chooses qualified saved players for launch, falling back to a temporary player only without a selection.

apps/frontend/src/panel/accounts.rs

login.rsSend Microsoft sign-in to the chosen launcher +11/-14

Send Microsoft sign-in to the chosen launcher

• Includes the launcher ID in Microsoft authentication requests while retaining the existing cancellation and progress flow.

apps/frontend/src/panel/accounts/login.rs

render.rsShow launcher picker and scoped Minecraft list +206/-59

Show launcher picker and scoped Minecraft list

• Adds a local launcher picker and creation controls above the active launcher's Minecraft accounts. Qualifies row actions and reauthentication by launcher, and shows an empty-list message without removing temporary play.

apps/frontend/src/panel/accounts/render.rs

third_party.rsBind third-party sign-in forms to a launcher +31/-17

Bind third-party sign-in forms to a launcher

• Stores the launcher's identity with each Yggdrasil form and includes it in initial sign-in requests. Profile choice continues through the worker's retained target.

apps/frontend/src/panel/accounts/third_party.rs

Bug fix (4) +259 / -201
sessions.rsScope account sessions and resolution by launcher +121/-105

Scope account sessions and resolution by launcher

• Keys cached sessions by launcher and Minecraft identity, and returns snapshots for the active launcher. Directs sign-in, selection, removal, and saved-player resolution through the current device root.

apps/core/lib/accounts/src/accounts/sessions.rs

persistence.rsScope keyring writes and credential cleanup +69/-66

Scope keyring writes and credential cleanup

• Uses device-scoped keys for new secrets while continuing to read legacy keys. Keeps credential reservation, retirement, refresh writes, and cleanup within the addressed root and account.

apps/core/lib/accounts/src/accounts/sessions/persistence.rs

login.rsRetain launcher targets throughout authentication +57/-18

Retain launcher targets throughout authentication

• Checks the addressed launcher before authentication and carries it through Microsoft and Yggdrasil sign-in. Associates pending Yggdrasil profile choices with their original launcher target.

apps/core/lib/accounts/src/worker/login.rs

launching.rsResolve every saved player within its launcher +12/-12

Resolve every saved player within its launcher

• Carries a qualified account key into launch resolution for both saved online and saved offline players. Temporary offline sessions remain a separate launch path.

apps/core/src/desktop/launching.rs

Tests (8) +531 / -82
sessions.rsAdapt session tests to scoped account storage +73/-55

Adapt session tests to scoped account storage

• Updates cancellation, refresh, keyring, and schema tests to use launcher-qualified operations and the new account file. Includes the new hierarchy test module.

tests/apps/core/lib/accounts/src/accounts/sessions.rs

hierarchy.rsTest ownership, migration, and hierarchy validation +288/-0

Test ownership, migration, and hierarchy validation

• Exercises independent launcher selections and sessions, isolation across device roots, and migration of schemas 1–3. Checks migration failure leaves the flat file intact and invalid hierarchy data is not rewritten.

tests/apps/core/lib/accounts/src/accounts/sessions/hierarchy.rs

yggdrasil.rsRetest Yggdrasil persistence with scoped keys +23/-16

Retest Yggdrasil persistence with scoped keys

• Adapts third-party account tests to migrated storage and launcher-qualified resolution while retaining token-refresh and revoked-session checks.

tests/apps/core/lib/accounts/src/accounts/yggdrasil.rs

worker.rsRetain scoped identity in worker cancellation test +10/-5

Retain scoped identity in worker cancellation test

• Updates the launch-metadata cancellation test to resolve a qualified Yggdrasil account key.

tests/apps/core/lib/accounts/src/worker.rs

launching.rsCheck saved offline launch uses account resolution +29/-0

Check saved offline launch uses account resolution

• Adds a regression test showing that a saved offline player attempts worker-based resolution rather than silently using a temporary session.

tests/apps/core/src/desktop/launching.rs

device_user.rsTest device-user digest stability and machine IDs +24/-0

Test device-user digest stability and machine IDs

• Checks that the current device-user digest is stable and hexadecimal, and that machine ID normalization rejects invalid or uninitialized values.

tests/apps/core/storage/src/device_user.rs

accounts.rsTest temporary and saved offline player selection +39/-0

Test temporary and saved offline player selection

• Verifies an empty launcher uses a temporary player and a selected saved offline player retains its launcher-qualified key.

tests/apps/frontend/src/panel/accounts.rs

embedded_workers.rsExercise launcher-scoped embedded worker requests +45/-6

Exercise launcher-scoped embedded worker requests

• Updates embedded-worker fixtures to obtain a launcher before account changes and verifies saved offline resolution. Adjusts cancellation assertions for the account file initialized on first read.

tests/tests/embedded_workers.rs

Other (2) +5 / -0
REUSE.tomlCover new platform and panel test files +3/-0

Cover new platform and panel test files

• Adds the new device-user implementation and tests, plus Accounts panel tests, to the existing SPDX path declaration.

REUSE.toml

Cargo.tomlAdd digest encoding and hashing dependencies +2/-0

Add digest encoding and hashing dependencies

• Adds hex and SHA-256 dependencies for device-user identifier derivation.

apps/core/storage/Cargo.toml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Migration drops a legacy extension field ✓ Resolved
Description
FlatAccounts::migrate renames an extension field called device_roots by inserting it under
legacy_device_roots without checking whether that name is already occupied. If a schema 1–3 file
contains both fields, the existing legacy_device_roots value is overwritten when migration saves
the file.

2. Saved accounts disappear if device identity lookup fails ✓ Resolved
Description
AccountService::new now returns an error whenever DeviceUserId::current() fails, and for_root
passes that error back up. So the accounts worker never starts in that case, even for saved offline
players that need no credentials. machine_id() returns None on every OS other than Windows,
Linux and macOS. It also returns None when /etc/machine-id is missing in both locations,
contains uninitialized, or ioreg fails. In each of these cases the user loses the Accounts list,
sign-in and saved-player launch, all of which worked before this PR.

Grey Divider

Tip of the day
💡 Did you know, you can turn these tips off under Display > Comment parts

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Keep document internals inside their owner and expose scoped
credential access and iterators instead of collection borrows.
Reduce nesting in the launcher picker and document the data scope.

Assisted-by: OpenAI Codex CLI 0.172.0
Acted-By: 新v学员 <xinvxueyuan@yeah.net>
Signed-off-by: 新v学员 <xinvxueyuan@yeah.net>
Keep a stable namespace in the local user configuration directory when
the native device principal is unavailable. Reuse the namespace across
worker restarts and bind it to the native identity once it recovers.

Assisted-by: OpenAI Codex CLI 0.172.0
Acted-By: 新v学员 <xinvxueyuan@yeah.net>
Signed-off-by: 新v学员 <xinvxueyuan@yeah.net>
Resolve the local account-binding directory through DataDir rather
than adding another entry point to the layout module.

Assisted-by: OpenAI Codex CLI 0.172.0
Acted-By: 新v学员 <xinvxueyuan@yeah.net>
Signed-off-by: 新v学员 <xinvxueyuan@yeah.net>
Stage the namespace and its native anchor in the local user
configuration directory before publishing each digest. Losing
concurrent workers reuse the winning binding.

Assisted-by: OpenAI Codex CLI 0.172.0
Acted-By: 新v学员 <xinvxueyuan@yeah.net>
Signed-off-by: 新v学员 <xinvxueyuan@yeah.net>
Resolve the native anchor in its own operation before associating the
installation namespace with that device.

Assisted-by: OpenAI Codex CLI 0.172.0
Acted-By: 新v学员 <xinvxueyuan@yeah.net>
Signed-off-by: 新v学员 <xinvxueyuan@yeah.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: domain Domain identifiers and base types module: frontend State, layout and window wiring module: repository Build, tooling and CI module: storage Filesystem and cache primitives status: unreviewed No maintainer has reviewed this yet version: 0.1.0 Version a report or pull request belongs to

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant