Skip to content

feat: typed install_app errors, payload signing, and lair error detail - #144

Closed
zo-el wants to merge 3 commits into
main-0.7from
feat/install-app-already-installed-typed
Closed

feat: typed install_app errors, payload signing, and lair error detail#144
zo-el wants to merge 3 commits into
main-0.7from
feat/install-app-already-installed-typed

Conversation

@zo-el

@zo-el zo-el commented Aug 13, 2026

Copy link
Copy Markdown
Member
  • install_app returns the typed ConductorError instead of an opaque string, so callers can match
    the real failure.
  • Runtime::sign_payload signs an arbitrary payload with a caller-chosen agent key, exposed as a Tauri
    command.
  • RuntimeError::Lair carries lair's own message, which it previously discarded.

@zo-el
zo-el had a problem deploying to Android Service Runtime Release August 13, 2026 05:34 — with GitHub Actions Failure
@zo-el
zo-el had a problem deploying to Android Service Runtime Release August 13, 2026 05:34 — with GitHub Actions Failure
@zo-el
zo-el had a problem deploying to Android Service Runtime Release August 13, 2026 05:34 — with GitHub Actions Failure
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d52f524-b54a-440c-bff9-5871023fcd8a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

Comment @coderabbitai help to get the list of available commands.

@zo-el
zo-el force-pushed the feat/install-app-already-installed-typed branch from 9bb7aec to 15a2b6a Compare August 13, 2026 06:16
@zo-el
zo-el had a problem deploying to Android Service Runtime Release August 13, 2026 06:16 — with GitHub Actions Failure
@zo-el
zo-el had a problem deploying to Android Service Runtime Release August 13, 2026 06:16 — with GitHub Actions Failure
@zo-el
zo-el had a problem deploying to Android Service Runtime Release August 13, 2026 06:16 — with GitHub Actions Failure
@zo-el zo-el changed the title feat: surface a typed AppAlreadyInstalled error from install_app feat: preserve the typed ConductorError from install_app Aug 13, 2026
Route `Runtime::install_app` through the conductor handle directly
(`install_app_bundle`) instead of `AdminInterfaceApi::handle_request`, which
flattens every conductor error into a print-only
`ExternalApiWireError::InternalError(String)` (holochain TODO B-01506).

Going direct preserves the typed `ConductorError`, which the existing
`From<ConductorError>` impl surfaces as `RuntimeError::Conductor(..)`, so callers
can match on the actual failure — e.g. the benign re-install case as
`ConductorError::AppAlreadyInstalled` — instead of grepping a Debug string.
Previously every install failure arrived as the opaque
`RuntimeError::AdminApiBadResponse`.

The success path mirrors the admin `InstallApp` handler (`get_dna_definitions` +
`AppInfo::from_installed_app`), and `check_running()` is preserved for fast-fail
parity with the sibling `req_admin_api` calls. `tauri-plugin-holochain`
re-exports `RuntimeError` and `ConductorError` so plugin consumers can
destructure the error without depending on the runtime crate directly.

Add `test_install_app_already_installed`, covering that the typed conductor error
survives the passthrough and that a failed re-install leaves the original app
untouched.
@zo-el
zo-el force-pushed the feat/install-app-already-installed-typed branch from 15a2b6a to 4b02203 Compare August 13, 2026 19:52
@zo-el
zo-el had a problem deploying to Android Service Runtime Release August 13, 2026 19:52 — with GitHub Actions Failure
@zo-el
zo-el had a problem deploying to Android Service Runtime Release August 13, 2026 19:52 — with GitHub Actions Failure
@zo-el
zo-el had a problem deploying to Android Service Runtime Release August 13, 2026 19:52 — with GitHub Actions Failure
@zo-el
zo-el requested a review from zippy August 13, 2026 19:52
@ThetaSinner
ThetaSinner requested review from a team and removed request for a team August 17, 2026 10:15
@ThetaSinner

Copy link
Copy Markdown
Member

Should this not go into main and be backported? No new changes should be going directly to maintenance branches

zo-el added 2 commits August 18, 2026 15:24
The Display impl dropped the wrapped OneErr's message, so every lair
failure (locked keystore, missing key, any other cause) rendered as
the identical bare string "Lair Error" with no way to tell them apart
from the caller side.
Runtime::sign_payload signs whatever bytes the caller supplies with a
specific agent key held by the keystore, for protocols beyond zome
calls that need proof of control over a Holochain identity (e.g.
signing a timestamp for a re-authentication handshake). The signing
key is always explicit: this keystore can hold more than one signable
identity at once (the device-seed key and, in authenticated mode, a
separate hc-auth key), and there is no default, since a signature from
the wrong key is still valid, just for the wrong identity.

Exposed through the in-process plugin as the sign_payload Tauri
command: raw agent-key bytes and payload in, a base64-encoded
signature out ready for a JSON body. Malformed key bytes from the
webview are rejected via the fallible HoloHash parse rather than the
panicking one used elsewhere at the FFI boundary, since this input
comes straight off the wire.
@zo-el
zo-el had a problem deploying to Android Service Runtime Release August 18, 2026 23:01 — with GitHub Actions Failure
@zo-el
zo-el had a problem deploying to Android Service Runtime Release August 18, 2026 23:01 — with GitHub Actions Failure
@zo-el
zo-el had a problem deploying to Android Service Runtime Release August 18, 2026 23:01 — with GitHub Actions Failure
@zo-el zo-el changed the title feat: preserve the typed ConductorError from install_app feat: typed install_app errors, payload signing, and lair error detail Aug 19, 2026
@zo-el

zo-el commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

Superseded by #146, which targets main as you suggested. Backport to main-0.6 to follow.

@zo-el zo-el closed this Aug 24, 2026
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.

2 participants