Skip to content

One app listing with a string dependencies or gallery makes its whole store disappear from the App Store #522

Closed

Description

@nixfred

What happens

loadStore() in omarchyd/apps.mjs assumes dependencies and gallery in an app's manifest are arrays:

const needsOf = (id, seen = new Set()) => {
	for (const d of (byId.get(id)?.a.dependencies ?? []).filter((x) => typeof x === 'string')) {   // ~line 882
...
const neededByOthers = new Set(found.flatMap((f) => (f.a.dependencies ?? []).filter(...)))          // ~line 889
const deps = (a.dependencies ?? []).filter((x) => typeof x === 'string')                            // ~line 891
...
gallery: (a.gallery ?? []).map(media).filter(Boolean),                                              // ~line 920

If a listing writes dependencies: bitcoin or gallery: shot.png (a scalar instead of a one-item list, an easy mistake in a third-party store), .filter / .map throws a TypeError. Nothing around it is guarded per app, so the throw aborts the whole store:

  • registry() wraps loadStore in an empty catch {}, so the store silently vanishes from App Store, search and update checks, including every healthy app in it. Nothing in the UI says why.
  • When someone adds such a store (appStore.addRepository), the call fails with the generic "Internal error" (the TypeError only reaches the server log), the store is removed again, and the user is not told which listing is at fault.

implements in the same function is checked with Array.isArray and just falls back to nothing, so dependencies and gallery are the odd ones out.

How to reproduce

I ran omarchyd with a fake run and a file:// store folder holding two apps, good (valid) and bad.

  1. bad has dependencies: good. appStore.addRepository({url}) fails with "Internal error"; the server log shows TypeError: (f.a.dependencies ?? []).filter is not a function. Same with gallery: shot.png (TypeError: (a.gallery ?? []).map is not a function).
  2. Add a valid store first, then let the store's repository gain gallery: shot.png in bad (a new upstream commit) and call appStore.refresh. appStore.registry then returns []: the store, and the valid good app with it, are gone.

Expected: the app with the bad field is listed without that field (or skipped by itself), and every other app in the store stays visible.

Suggested fix

Treat non-array dependencies and gallery as empty (for example Array.isArray(x) ? x : []) in loadStore, or wrap the per-app part of the loop in try/catch so one broken listing only drops itself.

Environment

Omarchy Server main (6aa7f7d, 0.9.52), Node 26.

Activity

  1. added a commit that references this issue on Nov 21, 2026
    e30eabb
  2. calledtoconstruct commented on Nov 21, 2026

    @calledtoconstruct
    Collaborator

    Thank you @nixfred. A dependency or gallery field that is not a list is ignored. The rest of that store stays visible. This is on main in #858.

    🤖 Generated with Grok 4.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions