fix(app): staging banner not showing on TestFlight builds#5950
Merged
Conversation
isUsingStagingApi read _instance.stagingApiUrl directly (empty — env var not set) instead of the stagingApiUrl getter which has the hardcoded fallback to https://api.omiapi.com/. Banner always returned false even when the app was running on staging. Fixes part of #5949 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Greptile SummaryThis PR fixes a one-line regression introduced in commit Key changes:
Considerations:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["isUsingStagingApi called"] --> B{"apiBaseUrl == null?"}
B -- yes --> C["return false"]
B -- no --> D["resolve stagingApiUrl getter"]
D --> E{"_instance.stagingApiUrl\nset in env file?"}
E -- yes --> F["use configured value"]
E -- no --> G["fallback: 'https://api.omiapi.com/'"]
F --> H{"_normalizeUrl(apiBaseUrl)\n== _normalizeUrl(stagingApiUrl)?"}
G --> H
H -- yes --> I["return true → show staging banner"]
H -- no --> J["return false → hide banner"]
style C fill:#f88,stroke:#f00
style I fill:#8f8,stroke:#0a0
style J fill:#f88,stroke:#f00
style G fill:#ff9,stroke:#a80
Reviews (1): Last reviewed commit: "fix(app): staging banner not showing whe..." | Re-trigger Greptile |
Glucksberg
pushed a commit
to Glucksberg/omi-local
that referenced
this pull request
Apr 28, 2026
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.
Fixes the staging environment banner never appearing despite the app running on
api.omiapi.com.isUsingStagingApi(env.dart:34-41) was reading_instance.stagingApiUrldirectly — which is always empty becauseSTAGING_API_URLenv var is not set in prod builds. ThestagingApiUrlgetter has a hardcoded fallback tohttps://api.omiapi.com/, but the banner check bypassed it. Introduced in commit2f2b2e01d3(Mar 16).Fix: use the
stagingApiUrlgetter (with fallback) instead of the raw_instance.stagingApiUrl.Closes part of #5949
by AI for @beastoin