fix(db/auth): resolve migration syntax errors and refactor initialization#716
fix(db/auth): resolve migration syntax errors and refactor initialization#716CodeWithCJ merged 2 commits intomainfrom
Conversation
CodeWithCJ
commented
Feb 22, 2026
- Fix "zero-length delimited identifier" error by correctly quoting database identifiers.
- Defer Better Auth SSO provider sync until after migrations and RLS policies are applied to prevent race conditions.
- Ensure stable server startup sequence by resolving scoping issues in SparkyFitnessServer.js.
- Add comprehensive documentation for external PostgreSQL setup, including security hardening and maintainer disclaimers.
…tion order - Fix "zero-length delimited identifier" error by correctly quoting database identifiers. - Defer Better Auth SSO provider sync until after migrations and RLS policies are applied to prevent race conditions. - Ensure stable server startup sequence by resolving scoping issues in SparkyFitnessServer.js. - Add comprehensive documentation for external PostgreSQL setup, including security hardening and maintainer disclaimers.
Summary of ChangesHello @CodeWithCJ, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the robustness and clarity of the application's database and authentication initialization. It addresses critical issues related to database identifier handling and the timing of SSO provider synchronization, which previously led to startup failures and race conditions. Additionally, it provides essential guidance for users deploying the application with external PostgreSQL instances, improving the overall maintainability and deployability of the system. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively resolves critical database migration and application startup issues. The fixes for SQL identifier quoting in grantPermissions.js and dbMigrations.js are correct and address the "zero-length delimited identifier" error. Refactoring the startup sequence to defer the SSO provider sync in SparkyFitnessServer.js is a solid improvement that prevents race conditions. Additionally, the new documentation for external PostgreSQL setup is comprehensive and a valuable addition for users. While reviewing the changes, I identified a pre-existing critical issue in auth.js where duplicate configuration keys would cause session settings to be ignored, and I've provided a comment with a suggested fix. Overall, these changes significantly improve the robustness and stability of the application's initialization process.