Skip to content

Warn when deployed studies use default Firebase config#1266

Merged
JackWilb merged 3 commits into
devfrom
codex/default-firebase-warning-1202
Jun 14, 2026
Merged

Warn when deployed studies use default Firebase config#1266
JackWilb merged 3 commits into
devfrom
codex/default-firebase-warning-1202

Conversation

@JackWilb

@JackWilb JackWilb commented Jun 10, 2026

Copy link
Copy Markdown
Contributor
Screenshot 2026-06-11 at 10 44 27 AM Screenshot 2026-06-11 at 10 45 00 AM

Summary

  • add a shared helper for detecting ReVISit's default Firebase project and suppressing default-deployment warnings on local/ReVISit-controlled hosts
  • add a parser warning category for default Firebase config so study cards use the existing warning UI
  • show a non-blocking Default Firebase badge in the direct study header
  • cover helper, parser, warning renderer, and header behavior with Vitest tests

Fixes #1202

Verification

  • yarn unittest --run src/utils/tests/defaultFirebaseConfig.spec.ts src/parser/tests/parser.spec.ts src/components/tests/ErrorLoadingConfig.spec.tsx src/components/interface/tests/AppHeader.spec.tsx
  • yarn eslint src/utils/defaultFirebaseConfig.ts src/utils/tests/defaultFirebaseConfig.spec.ts src/parser/parser.ts src/parser/types.ts src/parser/tests/parser.spec.ts src/components/ErrorLoadingConfig.tsx src/components/tests/ErrorLoadingConfig.spec.tsx src/components/interface/AppHeader.tsx src/components/interface/tests/AppHeader.spec.tsx
  • git diff --check -- src/utils/defaultFirebaseConfig.ts src/utils/tests/defaultFirebaseConfig.spec.ts src/parser/parser.ts src/parser/types.ts src/parser/tests/parser.spec.ts src/components/ErrorLoadingConfig.tsx src/components/tests/ErrorLoadingConfig.spec.tsx src/components/interface/AppHeader.tsx src/components/interface/tests/AppHeader.spec.tsx

Note

  • yarn typecheck is currently blocked by unrelated unstaged storage-engine changes in the worktree: src/tests/utils.ts does not implement _updateSnapshotParticipantCounts from StorageEngine.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

🪓 PR closed, deleted preview.

Comment thread src/components/interface/AppHeader.tsx
@jaykim1213

jaykim1213 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Looks great. I was wondering if we should open an issue for Supabase as well, e.g., warning when the default VITE_SUPABASE_URL is used with VITE_STORAGE_ENGINE="supabase".

Comment thread src/utils/defaultStorageConfig.ts
@JackWilb JackWilb linked an issue Jun 11, 2026 that may be closed by this pull request
8 tasks
@JackWilb

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback in 85aba38:

  • Removed the alert icon from the Default Firebase header badge so it matches the other status badges.
  • Added Firebase storageBucket detection for revisit-utah.appspot.com.
  • Added default Supabase warnings when VITE_STORAGE_ENGINE=supabase and VITE_SUPABASE_URL is on revisit.dev or a revisit.dev subdomain.

Local verification passed: focused Vitest suite, scoped ESLint, git diff --check, and yarn typecheck.

@JackWilb

Copy link
Copy Markdown
Contributor Author

Follow-up on the review feedback:

  • Removed IconAlertTriangle from the direct-study header badge. The Default Firebase and Default Supabase badges now match the existing text-only status badges like Demo Mode and Storage Disconnected.
  • Expanded the Firebase default-project detector to also check storageBucket equals revisit-utah.appspot.com, in addition to projectId and authDomain.
  • Added Supabase default-backend warnings. The rule is intentionally host-based: when VITE_STORAGE_ENGINE is supabase, we parse VITE_SUPABASE_URL and warn if its hostname is revisit.dev or any revisit.dev subdomain.
  • Wired the Supabase warning through the same parser warning UI on study cards and the same direct-study header badge path.
  • Added focused coverage for the new Firebase storage bucket case, Supabase URL detection, parser warning behavior, warning rendering, and direct header badge display.

Verification after the changes:

  • yarn unittest --run src/utils/tests/defaultFirebaseConfig.spec.ts src/parser/tests/parser.spec.ts src/components/tests/ErrorLoadingConfig.spec.tsx src/components/interface/tests/AppHeader.spec.tsx
  • scoped yarn eslint on the touched files
  • git diff --check
  • yarn typecheck

@JackWilb

Copy link
Copy Markdown
Contributor Author

Follow-up on the review feedback:

  • Removed the from the direct-study header badge. The Default Firebase and Default Supabase badges now match the existing text-only status badges like Demo Mode and Storage Disconnected.
  • Expanded the Firebase default-project detector to also check , in addition to and .
  • Added Supabase default-backend warnings. The rule is intentionally host-based: when , we parse and warn if its hostname is or any subdomain.
  • Wired the Supabase warning through the same parser warning UI on study cards and the same direct-study header badge path.
  • Added focused coverage for the new Firebase storage bucket case, Supabase URL detection, parser warning behavior, warning rendering, and direct header badge display.

Verification after the changes:

  • yarn run v1.22.22
    $ vitest --run src/utils/tests/defaultFirebaseConfig.spec.ts src/parser/tests/parser.spec.ts src/components/tests/ErrorLoadingConfig.spec.tsx src/components/interface/tests/AppHeader.spec.tsx

RUN v4.1.0 /Users/jwilburn/Projects/revisit-study

Test Files 4 passed (4)
Tests 67 passed (67)
Start at 23:45:07
Duration 2.09s (transform 545ms, setup 164ms, import 1.92s, tests 93ms, environment 2.61s)

Done in 2.65s.

  • scoped yarn run v1.22.22
    $ /Users/jwilburn/Projects/revisit-study/node_modules/.bin/eslint
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. on the touched files
  • yarn run v1.22.22
    $ tsc --noEmit
    Done in 11.03s.

@jaykim1213

Copy link
Copy Markdown
Contributor

Approved.
One small suggestion: could we rename defaultFirebaseConfig.ts to something likedefaultStorageConfig.ts since it now handles both Firebase and Supabase? Thank you!

@JackWilb JackWilb merged commit d93f834 into dev Jun 14, 2026
5 of 7 checks passed
@JackWilb JackWilb deleted the codex/default-firebase-warning-1202 branch June 14, 2026 01:46
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.

Add a warning if the firebase is still connected to the default (ours)

2 participants