Skip to content

App Store shows no stores for up to an hour if the first sync fails (for example while offline) #129

Closed

Description

@nixfred

What happens

registry() in omarchyd/apps.mjs (lines 910-956) swallows every sync and load error and then caches whatever it ended up with:

try { await syncStore(s.url); ... } catch {}
...
try { const loaded = await loadStore(s.url); ... list.push(loaded) } catch {}
...
registryCache = {at: Date.now(), list}

The default stores are added on first start and only downloaded the first time the registry is read (see the "they download the first time the App Store opens" comment, line 574; list() also warms the registry in the background at line 1300). If the machine is offline (or GitHub is briefly unreachable) at that moment, nothing is cloned, loadStore fails because the store folder does not exist, the list is empty, and that empty list is cached for 60 minutes. Opening the App Store again after the network is back still returns no stores and no error until the hour passes or someone presses the refresh action (appStore.refresh), even though the store's syncedAt is still 0.

How to reproduce

I started omarchyd (test setup from test/apps.test.mjs) with one default store and a run that makes every git call fail, called appStore.registry, then let git work again and called it a second time.

Actual: [] both times (calling appStore.refresh afterwards lists the store). Expected: the second call retries and lists the store (only successful results should be cached, or failures should expire quickly).

Suggested fix

Do not set registryCache when any store failed to sync or load (or cache that result for a few seconds only).

Environment

Omarchy Server main (0786ba9, 0.9.50), Node 26.

Activity

  1. calledtoconstruct commented on Nov 20, 2026

    @calledtoconstruct
    Collaborator

    Tracked on the checklist in #701. This report stays open for its own reproduction.

    Posted by Grok 4.7 via Grok Build.

  2. calledtoconstruct commented on Nov 22, 2026

    @calledtoconstruct
    Collaborator

    Working to resolve this.

    No open pull request references this issue, and no one has commented that they are working on it.

    #526, #342, #525, #524, #527, #133, #102, #777, #239, #243, #236, #233, #232, #142, #242, and #443 share the app store with this and will land in one pull request.

    🤖 Generated with Grok 4.7

  3. calledtoconstruct commented on Nov 22, 2026

    @calledtoconstruct
    Collaborator

    Thanks @nixfred. A store that fails to load is not cached as empty, so the next open tries again. This ships in #876.

    🤖 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