Skip to content

Match installed catalog apps by trusted repo identity - #38

Merged
hamzamerzic merged 1 commit into
mobius-os:mainfrom
hamzamerzic:fix/app-store-install-identity
Aug 23, 2026
Merged

Match installed catalog apps by trusted repo identity#38
hamzamerzic merged 1 commit into
mobius-os:mainfrom
hamzamerzic:fix/app-store-install-identity

Conversation

@hamzamerzic

Copy link
Copy Markdown
Contributor

Problem

The App Store decides whether a catalog entry is installed by matching its canonical <repo>#manifest-id=<id> key against installed rows. The <id> is volatile — it skews against the persisted install row whenever:

  • the catalog advertises main while the row is pinned to a reviewed commit,
  • the baked manifest snapshot is stale and its live refresh has not landed, or
  • the app's manifest was renamed (previous_idid), which the backend already adopts in _select_install_target but the client matcher did not.

Any of these desynced both the "installed" label and the otherInstalledCatalogItems de-dupe from the backend, so a genuinely-installed app could render as Not installed and appear twice — once as a curated card, once under "Other installed apps".

Fix

findInstalled now matches on the stable per-repository identity for trusted mobius-os root manifests — the "one app per repository" invariant trustedCatalogRepoBase already encodes — instead of the manifest-id string. Repo identity survives commit pins, snapshot staleness, and renames, so the display and de-dupe stay aligned with the backend without a client-side mirror of previous_id.

Exact canonical-key matching still runs first, so non-mobius-os and repo-subdirectory manifests (which have no trusted repo identity) match precisely, and a null-manifest legacy row still matches nothing.

Tests

Adds coverage in tests/helpers.test.mjs:

  • findInstalled matches across manifest-id skew (stale snapshot, rename, reverse rename) and stays repo-scoped (a different repo reusing the same id string does not match).
  • otherInstalledCatalogItems emits no duplicate card for a curated app whose installed row has a skewed manifest-id.

All helper tests pass locally (node --test tests/*.mjs).

The App Store recognized an installed app by its volatile #manifest-id=<id>
string, which skews against the persisted row on a commit pin, a stale baked
snapshot, or a source rename (previous_id -> id). Each skew desynced the
"installed" display and the other-installed de-dupe from the backend, so a
genuinely-installed app could show as "Not installed" and render twice.

Match on the stable per-repository identity instead (one app per trusted
mobius-os root-manifest repo), which survives all of those skews. Exact
canonical-key matching still comes first for non-mobius-os and subdirectory
manifests.

Co-authored-by: Möbius Agent <mobius-agent@users.noreply.github.com>
@hamzamerzic hamzamerzic added the bug Something isn't working label Aug 21, 2026

@miljanm miljanm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewer: all clear

I didn't find a concrete issue in this revision. This is a QA second look, not a maintainer approval.

Reviewed revision 33d987a011b9.

@hamzamerzic
hamzamerzic merged commit 3ae13dd into mobius-os:main Aug 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants