Repository navigation
fix(apps): let catalog apps start their work and probe upstreams - #624
Conversation
…ring The app manager activates a registered generation only after the app reports ready. An app that starts its work as soon as it serves, like Monitoring 1.0.0, calls the App API in that window. The platform answered 401 unauthorized, which the SDK defines as an absent or invalid credential. The app read that as a stale generation and stopped its legacy handoff and host sync for good, so the handoff never began. A generation that is still preparing, with a valid lease, now gets a retryable 503 generationPreparing. The SDK clients repeat a 503 read or keyed change, and the call succeeds once the manager activates the generation. Context reads and secret staging keep working while preparing. A revoked generation, an expired lease or an unknown generation still gets 401. The broker now refuses a provider invocation of a preparing generation as unavailable instead of a rejected identity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
App upstream probes passed the installation ID to the controller for the per-installation probe budget. The web client and the controller both required a UUID there, but the app manager names a catalog installation `app-` plus 32 hex digits. Every probe of a catalog app was rejected as invalid input, and Monitoring recorded every check as unknown with runtime_unavailable. Both sides now accept any app record ID, the format the web authority and the app manager use for installations. The core keeps one shared `is_record_id` in `app_install`, which the IPC launch identity, the secret grant check and the probe validation all use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou'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 46 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
… app fixture The native app fixture asserted 401 for calls of its preparing generation. A preparing generation now gets 503 generationPreparing, so the fixture checks that status and problem code instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
An end-to-end test with the real published app found two platform bugs. The test ran on an appliance built from
main(4206bb6) on a local Docker host, with synthetic hosts, history and an open outage. Monitoring 1.0.0 was installed from the public signed catalog through the real app manager. Neither bug shows up in the existing tests, because those use fake apps with UUID installation IDs and apps that wait before calling the platform.1. The legacy handoff never began
The manager activates a registered generation only after the app reports ready. Monitoring starts its work as soon as its socket answers, about 200 ms earlier. A tap between the broker and the web gateway showed this order:
The SDK documents 401 as "the request credential is absent or invalid". The app, like the template and Greeting, therefore treats 401 as a stale generation and stops its handoff loop and host sync for good. Built-in monitoring kept running, so no data was lost, but the app never took over.
Fix: a generation that is still
preparingand has a live lease now gets a retryable 503generationPreparing.contextreads and secret staging keep working while preparing, as before.2. App upstream probes always failed
App probes pass the installation ID to the controller for the per-installation probe budget. The web client (
z.uuid()) and the controller (is_canonical_uuid) both required a UUID there, butcore/src/app_manager/catalog.rsnames catalog installationsapp-plus 32 hex digits. Every probe from a catalog app was rejected asinvalid_input, and Monitoring recorded every check asunknown/runtime_unavailable.Fix: both sides now accept any app record ID (
^[a-z0-9][a-z0-9_-]{0,63}$), the format the web authority (appRecordId) and the manager already use. The core now has a singleapp_install::is_record_id, used by the IPC launch identity, the secret grant check and the probe validation. It replaces two identical private copies.Related issue
Refs RentnerProxy/app-monitoring#1. Found by the first end-to-end handoff of the published app (Monitoring Phase 4). No separate issue, because the fix comes with its own regression tests.
Type of change
Testing
Tests changed or added:
authority.db.test.ts: before activation the response is 503generationPreparing. Afterrevoke, the same generation gets 401unauthorized. Principal resolution reportspreparing.providers.db.test.tsandLegacyHandoff/app-api.db.test.ts: expect the retryable 503 where they previously expected 401 for a preparing generation.Controller/domain-diagnostics.test.tsandcore/tests/private/domain_diagnostics.rs: catalog installation IDs and UUIDs are accepted. Uppercase, empty, a leading-, spaces and 65 characters are rejected.Commands run:
bun --no-env-file run typecheckandbun --no-env-file run lint(oxlint with type-aware rules)AppRuntime,LegacyHandoff,HostMonitoringandAppUiDB tests against a fresh PostgreSQL 18.7 afterdb:migrate, plus the AppRuntime unit tests. A full batch on the slow local database hit the 5 s timeout in two tests that are unrelated and change between runs. Each passes on its own.cargo check --tests,cargo fmt --checkand all 43domain_diagnosticsRust tests. The Linux-only modules are compiled by the appliance image build, and CI runs their tests natively.End-to-end (appliance image from this branch, same volume, i.e. an in-place update with Monitoring installed):
healthy.e2e.testreturns 200 from the upstream,down.e2e.testreturns 502healthy.e2e.testhealthy /expected_status(HTTP 200, 10–13 ms),down.e2e.testunhealthy /upstream_dns_failed. Before the probe fix, every check wasunknown/runtime_unavailableChecklist
Breaking changes
None for apps. A preparing generation now sees 503 instead of 401. Apps built on the SDK clients retry 503 automatically. Apps that treated 401 as stale no longer stop at startup.
Screenshots
None
🤖 Generated with Claude Code
Summary by CodeRabbit