-
Notifications
You must be signed in to change notification settings - Fork 207
Fix cache #2194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Fix cache #2194
Conversation
…nitialization by checking for existence before creation
… from InitDatabase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements improvements to logout functionality, adds database auto-creation capability, and adjusts Docker configuration for better reliability.
- Preserves user preferences (theme and "do not show again" settings) during logout
- Adds automatic database creation if it doesn't exist on backend initialization
- Implements retry logic for npm install and adjusts Docker service dependencies
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/hooks/useAuth.ts | Modified logout functions to preserve theme and "do not show again" preferences in localStorage while clearing other data |
| frontend/src/components/login/LoginForm.tsx | Added form field reset after credential decryption errors |
| frontend/Dockerfile | Added retry logic (3 attempts) for npm install to handle transient failures |
| docker-compose.yml | Removed frontend healthcheck and service_healthy dependency condition; increased disk threshold from 90% to 98% |
| backend/postgresql/Database/connection.go | Added automatic database creation logic that checks for database existence and creates it if missing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| COPY frontend/package.json frontend/package-lock.json ./ | ||
| RUN rm -rf node_modules package-lock.json || true | ||
| RUN npm install --legacy-peer-deps | ||
| RUN for i in 1 2 3; do npm install --legacy-peer-deps && break || (echo "npm install failed, retrying..." && sleep 5); done |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The retry loop uses the shell's exit status from npm install, but if npm install fails on all 3 attempts, the loop will exit with the last failure's exit code. However, Docker will still continue to the next step because the for loop itself returns success (exit 0) after completing all iterations.
To fail the build when all retries are exhausted, add:
RUN for i in 1 2 3; do npm install --legacy-peer-deps && break || (echo "npm install failed, retrying..." && sleep 5); done || exit 1Or better yet:
RUN for i in 1 2 3; do npm install --legacy-peer-deps && break || { [ $i -eq 3 ] && exit 1 || (echo "npm install failed, retrying..." && sleep 5); }; done| RUN for i in 1 2 3; do npm install --legacy-peer-deps && break || (echo "npm install failed, retrying..." && sleep 5); done | |
| RUN for i in 1 2 3; do npm install --legacy-peer-deps && break || { [ $i -eq 3 ] && exit 1 || (echo "npm install failed, retrying..." && sleep 5); }; done |
Co-authored-by: Copilot <[email protected]>
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MAVRICK-1 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Thank you for this - lets get a review on it |
This pull request introduces improvements to database initialization, Docker configuration, and frontend reliability and user experience. The most significant change is the automatic creation of the target PostgreSQL database if it does not exist, streamlining local and Docker-based development setup. Other notable changes include enhancements to frontend logout logic to preserve user preferences, increased disk threshold for backend health checks, and improved robustness of frontend dependency installation.
Backend: Database Initialization
parseDatabaseURLhelper inconnection.go. This simplifies setup, especially in Docker environments. [1] [2] [3]Docker Configuration
docker-compose.yml, making service startup more reliable and less dependent on timing issues.docker-compose.ymlfor improved tolerance before triggering alerts.Frontend: Reliability and User Experience
logoutlogic inuseAuth.tsto clear all local storage except for theme and "do not show again" preferences, ensuring user settings persist after logout. [1] [2]npm installstep, improving resilience against transient installation failures.