Skip to content

feat: add named Firestore database support#1

Merged
flowdeskadmin merged 1 commit intoFlowdesktech:masterfrom
Rixmerz:master
Feb 19, 2026
Merged

feat: add named Firestore database support#1
flowdeskadmin merged 1 commit intoFlowdesktech:masterfrom
Rixmerz:master

Conversation

@Rixmerz
Copy link
Copy Markdown
Collaborator

@Rixmerz Rixmerz commented Feb 16, 2026

Summary

  • Add optional Database ID field in the Service Account connection dialog, enabling connections to named Firestore databases (not just (default))
  • Propagate databaseId through the full chain: UI → Redux → preload bridge → Firebase Admin SDK (db.settings({ databaseId }))
  • Persist databaseId in localStorage for automatic reconnection
  • Bump version to 1.6.0

Test plan

  • Connect with a service account and a named database ID (e.g. my-docs) — verify collections load from that database
  • Connect without database ID — verify it works as before (default database)
  • Close and reopen the app — verify reconnection uses the saved databaseId
  • Verify all features (collections, console, storage, auth) pass the databaseId on reconnect

🤖 Generated with Claude Code

@flowdeskadmin
Copy link
Copy Markdown
Member

@Rixmerz Thank you for your contribution and I appreciate it.
Please update github actions to use pnpm or just revert pnpm to npm.

@Rixmerz Rixmerz force-pushed the master branch 2 times, most recently from 0c4e3e4 to 8ce2fa4 Compare February 17, 2026 06:52
@Rixmerz
Copy link
Copy Markdown
Collaborator Author

Rixmerz commented Feb 17, 2026

Ready!, thx to you to let me contribute to this excellent project!!

@flowdeskadmin
Copy link
Copy Markdown
Member

flowdeskadmin commented Feb 18, 2026

@Rixmerz Thank you. Btw we should update readme for pnpm(Also maybe add pnpm install instruction).
Current readme shows npm install guide.

@flowdeskadmin
Copy link
Copy Markdown
Member

Thank you for adding test too.
Could you add github CI steps to run added unit tests?

@Rixmerz Rixmerz force-pushed the master branch 2 times, most recently from 115834d to a05e81b Compare February 18, 2026 13:07
@Rixmerz
Copy link
Copy Markdown
Collaborator Author

Rixmerz commented Feb 18, 2026

updated

@Flowdesktech Flowdesktech deleted a comment from qiangli108 Feb 18, 2026
@flowdeskadmin
Copy link
Copy Markdown
Member

Test fail in CI. Please fix
https://github.com/Flowdesktech/firestudio/actions/runs/22140972523/job/64004860368

 ✓ src/features/projects/store/projectsSlice.test.ts (9 tests) 21ms
stderr | src/features/projects/store/projectsPersistence.test.ts > loadProjectsFromStorage > returns empty array for malformed JSON
Failed to load projects SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2)
    at JSON.parse (<anonymous>)
    at loadProjectsFromStorage (/home/runner/work/firestudio/firestudio/src/features/projects/store/projectsPersistence.ts:14:25)
    at /home/runner/work/firestudio/firestudio/src/features/projects/store/projectsPersistence.test.ts:11:12
    at file:///home/runner/work/firestudio/firestudio/node_modules/@vitest/runner/dist/index.js:145:11
    at file:///home/runner/work/firestudio/firestudio/node_modules/@vitest/runner/dist/index.js:915:26
    at file:///home/runner/work/firestudio/firestudio/node_modules/@vitest/runner/dist/index.js:1243:20
    at new Promise (<anonymous>)
    at runWithTimeout (file:///home/runner/work/firestudio/firestudio/node_modules/@vitest/runner/dist/index.js:1209:10)
    at file:///home/runner/work/firestudio/firestudio/node_modules/@vitest/runner/dist/index.js:1653:37
    at Traces.$ (file:///home/runner/work/firestudio/firestudio/node_modules/vitest/dist/chunks/traces.CCmnQaNT.js:142:27)


- Add optional Database ID field in the Service Account connection dialog,
  enabling connections to named Firestore databases instead of only (default)
- Propagate databaseId through the full chain: UI → Redux → preload → backend
- Persist databaseId in localStorage for automatic reconnection
- Expose FieldValue, Filter, Timestamp, and GeoPoint in JS Query sandbox
- Migrate GitHub Actions workflows (CI + Build & Release) from npm to pnpm
- Update README, SECURITY.md, husky hooks, and error messages for pnpm
- Add unit tests for controllers and Redux slices with vitest
- Add test step to CI workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Rixmerz
Copy link
Copy Markdown
Collaborator Author

Rixmerz commented Feb 18, 2026

Fixed! The test stderr output was expected behavior (testing malformed JSON handling), not an actual failure — all 28 tests were passing. However, the console.error stack trace in CI logs was confusing, so I've silenced it by mocking console.error in that specific test while still asserting it gets called. CI logs should now be clean.

@flowdeskadmin
Copy link
Copy Markdown
Member

By the way, just curious could you tell me the reason to force push every time?

@flowdeskadmin flowdeskadmin self-requested a review February 18, 2026 13:49
@Rixmerz
Copy link
Copy Markdown
Collaborator Author

Rixmerz commented Feb 18, 2026

The force pushes were to keep the PR clean with a single commit — since all the corrections (CI migration, README update, test fix) should have been part of the original commit from the start. Easier to review as one cohesive change rather than a chain of fix-on-top-of-fix commits. Just for that xD

@flowdeskadmin
Copy link
Copy Markdown
Member

flowdeskadmin commented Feb 18, 2026

Aha, I see It's a hard to review after last changes though. As I have to re-review all files

@flowdeskadmin flowdeskadmin merged commit 1a7ca2d into Flowdesktech:master Feb 19, 2026
1 check passed
@Rixmerz
Copy link
Copy Markdown
Collaborator Author

Rixmerz commented Feb 19, 2026

46a464c47cd7e4eeec96d79f5454c1f5

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.

2 participants