Skip to content

fix(app): load the app catalog on Integrations when apps came from the cache - #20497

Merged
mdmohsin7 merged 3 commits into
mainfrom
fix/integrations-catalog-loads
Oct 3, 2026
Merged

mdmohsin7 merged 3 commits into
mainfrom
fix/integrations-catalog-loads

Conversation

@mdmohsin7

@mdmohsin7 mdmohsin7 commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Summary

The app catalog under Settings → Integrations shows nothing below the search bar for anyone who has used apps before.

  • Cause: Mobile: simplify the app shell — one Home feed, Ask Omi sheet, global search #19730 moved the old Apps tab's catalog onto Integrations and gated its load on appProvider.apps.isEmpty. The old Apps tab called getApps() on every open.
  • Why the gate skips: start-up fills apps from the local cache (app_shell.dart, setAppsFromCache()), so getApps() never runs.
  • Result: groupedApps, the only thing the catalog draws, stays empty and the page is blank.

Change

  • AppProvider.ensureCatalogLoaded() owns the decision now. It fetches the catalog when groupedApps is empty, keyed on the data the catalog actually draws rather than apps. It also loads popular apps when that list is empty, as before.
  • IntegrationsPage calls it instead of the apps.isEmpty check.
  • No duplicate fetches: getApps() already coalesces concurrent loads.

Product invariants affected

none

Failure class

Failure-Class: none

Verification

  • New test in test/providers/app_provider_load_test.dart sets up the failing state: apps filled from the cache, groupedApps empty. It asserts that ensureCatalogLoaded() fetches the catalog once and fills the groups.
  • flutter test test/providers/app_provider_load_test.dart test/providers/app_provider_enabled_fetch_failure_test.dart: 6 tests pass.
  • flutter analyze on the changed files: only the two avoid_print infos already on main.
  • scripts/pr-preflight --pr-body-file <this body>: passes.
  • Not yet checked in the running app.

🤖 Generated with Claude Code

Review in cubic

…e cache

#19730 moved the Apps tab catalog onto Settings > Integrations and gated
its load on `appProvider.apps.isEmpty`. Start-up fills `apps` from the
local cache (app_shell setAppsFromCache), so for anyone who had used apps
before, getApps() never ran, `groupedApps` stayed empty, and the catalog
under the search bar was blank. The old Apps tab called getApps() on
every open.

AppProvider.ensureCatalogLoaded() now owns that decision and keys it on
`groupedApps`, the data the catalog draws; Integrations calls it.
Duplicate loads are already coalesced by getApps().

Verification:
- flutter test test/providers/app_provider_load_test.dart
  test/providers/app_provider_enabled_fetch_failure_test.dart: 6 pass,
  including the new cached-apps case.
- flutter analyze on the changed files: only the two existing avoid_print
  infos already on main.

Failure-Class: none

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread app/lib/providers/app_provider.dart Resolved
@mdmohsin7
mdmohsin7 merged commit d4062b9 into main Oct 3, 2026
53 of 55 checks passed
@mdmohsin7
mdmohsin7 deleted the fix/integrations-catalog-loads branch October 3, 2026 20:43
sanjayJ369 added a commit to sanjayJ369/omi that referenced this pull request Oct 6, 2026
…asedHardware#20500)

The CAP_APP_ACK_RECLAIM download test sampled the card's advances after a
fixed 300 ms sleep. Under CI load the first chunk's checkpoint persist and
proof validation had not finished by then, so the incremental advance
landed after the snapshot and the test failed with 0 advances (PR BasedHardware#20497
run 37150132070, attempt 1). This was a timing flake, not a custody write
outliving teardown.

The fake card now completes a future on its first advance, and the test
waits for it, bounded at 10 s, before sending the last records and DONE.
A missing incremental advance still fails the existing expectation.
kodjima33 pushed a commit that referenced this pull request Oct 7, 2026
…20500) (#20638)

* fix(app): flush pendant custody writes before tests delete storage (#20500)

Ring-custody checkpoint writes are serialized on a save/IO queue, and
mismatch invalidation and ring reincarnation persist them fire-and-forget.
Nothing let a caller wait for queued writes, so tests that delete their
custody directory after a fixed 50ms settle raced them: the queued
`.json.tmp` -> rename ran after teardown and failed the suite with
PathNotFoundException "after it has completed" (main and unrelated PRs).

- PendantRingCustody.flush() / PendantCustodyStore.flush(): complete once
  every write queued so far has landed, re-checking for writes queued while
  waiting.
- The three flaky suites end the custody session (disconnect) and flush
  before deleting storage; ring_custody_download_test flushes every custody
  it creates before removing the path_provider mock, and
  pendant_custody_main_red_test flushes the shared custody.
- pendant_ring_custody_flush_test.dart gates the store's directory so a
  fire-and-forget write is provably pending and pins flush() semantics.

* fix(app): re-check queued custody checkpoints after each store flush

A checkpoint queued while flush() waited on the store reached the I/O queue
only after its predecessor's save, so flush() could return with it still
pending. flush() now waits on the store inside the checkpoint-queue loop.

The teardown regression test asserted on uncaught errors, but noteInfo
already logs and swallows a failed write, so it passed without flush().
It now checks what reached disk before the directory is deleted, and a new
test pins the store-wait race.

* fix(app): drain open sessions' live-mark writes in custody flush

flush() only waited on the checkpoint queue, but an open session's live
marks enqueue their persists lazily on its mark chain, so a test could
flush, delete storage, and have a later mark write recreate it. flush()
now also waits on every open session's mark chain until both are stable.

Every custody test that deletes storage now flushes each custody it built
first: pendant_ring_custody_test and local_wal_live_custody_test leaked
recreated temp dirs on every run. The two wrap tests that queue thousands
of marks end their session so the queued persists are dropped, and the
disconnect test flushes in finally. The flush tests read the checkpoint
from disk synchronously so an early return cannot hide behind the store
queue, and a new test pins the store-level loop.

* test(app): end the wrap test's custody session even when it fails

The u16 wrap test queues about 3300 mark persists; it now ends its session
through addTearDown right after beginConnection, so a failing expectation
does not leave teardown's flush writing them one by one past the timeout.
The two-mark wrap test no longer needs that. A comment now says why
flush() re-checks the mark chains as well as the save queue.

* test(app): wait for the incremental advance instead of a fixed sleep (#20500)

The CAP_APP_ACK_RECLAIM download test sampled the card's advances after a
fixed 300 ms sleep. Under CI load the first chunk's checkpoint persist and
proof validation had not finished by then, so the incremental advance
landed after the snapshot and the test failed with 0 advances (PR #20497
run 37150132070, attempt 1). This was a timing flake, not a custody write
outliving teardown.

The fake card now completes a future on its first advance, and the test
waits for it, bounded at 10 s, before sending the last records and DONE.
A missing incremental advance still fails the existing expectation.

* test(app): await the pendant drain instead of sleeping on it (#20500)

The 10s custody-window test fired the drain timer's callback by hand,
dropped the Future it returned, and read the WAL index after a fixed
300 ms sleep. Under CI load the index save had not landed by then, so
the test failed with no disk WAL (main at 4e93805). Because that
skipped sync.stop(), teardown then deleted tempDir under the still
running save, which failed again "after test completion" renaming
wals.json.tmp. That is a WAL index write, so the custody flush in
tearDown could not cover it.

The test now drives the timers with the existing ManualScheduler: it
elapses the 10s window and awaits waitForCallbackIo(), which completes
once the drain, its audio write and the index save have finished. The
body runs in try/finally with sync.stop(), which queues behind any
drain still running, so no index write outlives tempDir even when an
expectation fails. The changelog exemption reason now covers both
timing fixes.
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.

1 participant