Skip to content

Fix: Migration - never lose the 1.x identity on a transient failure. - #288

Merged
Amirhesp merged 1 commit into
developfrom
fix/identity-carry-hardening
Nov 17, 2026
Merged

Amirhesp merged 1 commit into
developfrom
fix/identity-carry-hardening

Conversation

@Amirhesp

@Amirhesp Amirhesp commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #284

Summary

Hardens the 1.x -> 2.0 identity carry-over (#284). Losing the 1.x agent key
is permanent: membrane proofs name the agent, so a new key locks the user out
of every private conversation they did not create.

Rule

A new agent only when there is no 1.x identity, or lair is confirmed not to
hold its key. Everything else is an error: dialog, app closes, next launch
retries.

"Confirmed missing" = lair signs with its device key, and the 1.x key fails
with exactly the error a random key gets, which must be lair's own
"Query returned no rows". (The device key is served from lair's memory
cache, so a broken database would otherwise make every other key fail alike.)

Changes

  • agent_to_install_under: the rule above; the install fallback to a new
    agent is gone.
  • carry_keystore_forward returns errors; on error the Holochain plugin is
    not registered, so no empty keystore is created in holochain/2.
  • rewrite_lair_config uses LairServerConfigInner (fixes the socket path
    staying in holochain/1 on macOS).
  • A 1.x store without a readable lair config: fresh start.
  • holochain/2 is 0700; symlinked directories are followed.
  • ensure_app_enabled: re-enables an app left disabled by an interrupted
    first start or coordinator update (pre-existing bug).
  • report_setup_failure: error dialog instead of a panic or a silent exit.

Tests

cargo test --features holochain_bundled --lib: 23 pass, including:

  • a keystore written by lair 0.6.3 exactly as 1.x wrote it, carried, then
    signing as its agent in lair 0.7.1;
  • real lair 0.7.1 pinning the "no such key" answer;
  • the probe's decision for locked / broken / held / missing keys;
  • copy failure, path with a space, named pipe, missing or unparsable config.

Not covered by unit tests: the dialog and ensure_app_enabled. To be
checked in the #275 two-device run (1.0.5 -> this build).

Known limit

If lair cannot open the carried keystore at all, the app shows the error on
every start. There is deliberately no automatic new identity; support can
move holochain/2 aside.

TODO:

  • CHANGELOG updated

@Amirhesp
Amirhesp merged commit 3ff058d into develop Nov 17, 2026
1 check passed
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