Repository navigation
Conversation
…e in prebuilt configs
Greptile SummaryThis PR fixes a Firebase project mismatch that was causing 401 errors during Key changes:
Issues found:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[App initialises Firebase] --> B[Auth token issued for production project]
B --> C[API call to backend]
C --> D[Token validated successfully]
D --> E[HTTP 200 returned]
B --> F[Storage operation using mismatched bucket]
F --> G[HTTP 403 returned]
Reviews (1): Last reviewed commit: "fix: update Firebase project from based-..." | Re-trigger Greptile |
| messagingSenderId: '1031333818730', | ||
| projectId: 'based-hardware-dev', | ||
| projectId: 'based-hardware', | ||
| storageBucket: 'based-hardware-dev.firebasestorage.app', |
There was a problem hiding this comment.
Stale
storageBucket still references based-hardware-dev
The projectId has been correctly updated to based-hardware across all four platform configs (android, ios, web, macos), but the storageBucket on every entry still points to based-hardware-dev.firebasestorage.app. Firebase Storage access is scoped to the project that owns the bucket. If the app issues any storage reads/writes using these configs, the token minted against the based-hardware project will not be authorized to access a bucket that belongs to based-hardware-dev, resulting in a 403 Forbidden from Firebase Storage.
If the intent is to migrate fully to the based-hardware project the storageBucket values should be updated as well:
| storageBucket: 'based-hardware-dev.firebasestorage.app', | |
| storageBucket: 'based-hardware.firebasestorage.app', |
The same applies to the ios (line 56), web (line 68), and macos (line 76) configs — all four storageBucket fields need the same update.
Also note that the web config still has authDomain: 'based-hardware-dev.firebaseapp.com' (line 67), which should become based-hardware.firebaseapp.com so that web OAuth redirect flows use the correct Firebase Hosting domain for the production project.
| "project_number": "1031333818730", | ||
| "project_id": "based-hardware-dev", | ||
| "project_id": "based-hardware", | ||
| "storage_bucket": "based-hardware-dev.firebasestorage.app" |
There was a problem hiding this comment.
storage_bucket still points to the old based-hardware-dev project
The top-level storage_bucket in project_info still reads based-hardware-dev.firebasestorage.app even though project_id has been updated to based-hardware. The Android SDK reads this value when initialising FirebaseStorage. Calls to Cloud Storage from Android will therefore present a based-hardware identity token to a bucket owned by based-hardware-dev, which will be rejected.
| "storage_bucket": "based-hardware-dev.firebasestorage.app" | |
| "storage_bucket": "based-hardware.firebasestorage.app" |
| <string>based-hardware-dev</string> | ||
| <string>based-hardware</string> | ||
| <key>STORAGE_BUCKET</key> | ||
| <string>based-hardware-dev.firebasestorage.app</string> |
There was a problem hiding this comment.
STORAGE_BUCKET still references the old based-hardware-dev project
PROJECT_ID is now correctly based-hardware, but the STORAGE_BUCKET key still holds based-hardware-dev.firebasestorage.app. The iOS Firebase SDK uses this key to determine which bucket to target for storage operations. Any Firebase Storage call on iOS will fail with a permission error because the based-hardware identity token does not grant access to the based-hardware-dev bucket.
| <string>based-hardware-dev.firebasestorage.app</string> | |
| <string>based-hardware.firebasestorage.app</string> |
Before confirming cancellation, users are now asked to select a reason from predefined options (too expensive, not using enough, missing features, found alternative, temporary break, other). Optional details can also be provided. The reason and details are passed to the backend and logged. - Add UnsubscribeReasonDialog component with 6 reason options and optional details textarea - Update PlansSheet to show reason dialog before cancel confirmation - Update cancelSubscription API to accept reason and details parameters - Update backend endpoint to accept and log cancellation reason Fixes BasedHardware#5904
|
AI PRs with low efforts are not welcome here. Thank you. — by CTO |
|
Hey @sungdark 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! 💜 |
Summary
Fix Firebase project mismatch causing 401 errors in setup.sh.
Problem: The prebuilt Firebase configs in were referencing
based-hardware-dev, but the dev backend (api.omiapi.com) now validates tokens against thebased-hardware(prod) Firebase project. This project mismatch caused all API calls to return 401.Root Cause (confirmed in issue #5939):
GOOGLE_CLOUD_PROJECT: based-hardwarebased-hardware-devChanges (3 files updated):
app/setup/prebuilt/firebase_options.dart:projectIdupdated frombased-hardware-devtobased-hardware(3 occurrences)app/setup/prebuilt/google-services.json:project_idupdated frombased-hardware-devtobased-hardwareapp/setup/prebuilt/GoogleService-Info.plist:PROJECT_IDupdated frombased-hardware-devtobased-hardwareFiles changed:
app/setup/prebuilt/firebase_options.dartapp/setup/prebuilt/google-services.jsonapp/setup/prebuilt/GoogleService-Info.plist