Add optional sources filter to conversations count endpoint#8873
Merged
Conversation
Lets clients ask whether an account has conversations from specific capture sources (e.g. friend/omi wearables). When the filter is applied the response echoes it back, so clients can distinguish a filtered count from an older backend that ignored the unknown param and returned the unfiltered total. statuses and sources cannot combine (single Firestore in-filter per query). Verified against real data over HTTP: filtered count + echo for an account with wearable history, zero for one without, legacy shape unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…or tests Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
kodjima33
added a commit
that referenced
this pull request
Jul 2, 2026
…ory (#8875) The home Omi Device row only reflected a device paired to this Mac via BLE — wearables usually pair on mobile, so desktop always showed it unconnected. Now the row shows **Connected** when the account has any `friend`/`omi`-sourced conversations, via the new `sources` filter on `/v1/conversations/count` (#8873). The client strictly decodes the `{count, sources}` echo, so an older backend that ignores the param can never produce a false positive (verified fail-closed against prod). Result is sticky-cached in UserDefaults. ## Verification (local end-to-end) - Local backend running the endpoint + local app build (`omi-subtitle` named bundle, real launch path): Omi Device row renders **Connected** for an account with a wearable conversation — screenshot in workspace. - Fail-closed: same build against prod backend (no `sources` support) shows no badge. - `swift build` clean; backend tests 36/36 on the paired PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/8875?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend half of the home-page "Omi Device → Connected" feature (desktop half follows separately).
GET /v1/conversations/count?sources=friend,omicounts conversations from the given capture sources (single Firestoreinfilter; cannot combine withstatuses, 400 if both).sourcesis applied, the response echoes it ({count, sources}) so clients can tell a filtered count from an older backend ignoring the unknown param — prevents false positives during rollout.Verified over HTTP against real accounts (local backend, prod Firestore): 9,531 for a wearable account, 0 for one without, no composite-index issues with combined equality filters.
🤖 Generated with Claude Code