You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add end-to-end tests for email login/logout and global settings access control
- Implemented E2E tests for email login and logout functionality, covering both admin and regular user scenarios.
- Verified session management and cookie handling during login/logout processes.
- Added tests to ensure proper rejection of invalid login attempts.
- Created E2E tests for global settings access control, differentiating between admin and regular user permissions.
- Included tests for CRUD operations on settings, ensuring proper access control and response validation.
- Established global setup and teardown scripts for consistent test environment initialization and cleanup.
- Enhanced test context management for sharing state across tests.
- Updated TypeScript configuration to include test files and improve module resolution.
- Optimized router behavior to reduce unnecessary API calls during navigation.
- Improved user feedback in setup success messages.
Copy file name to clipboardExpand all lines: services/backend/DB.md
+38-1Lines changed: 38 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,31 @@ The request body should be:
47
47
48
48
Replace the `connectionString` with your actual PostgreSQL connection URI.
49
49
50
-
**Important:** After the initial database setup via this API, you **must restart the backend server** for the changes to take full effect and for the application to connect to the newly configured database.
50
+
**Note:** The database setup is now complete in a single API call. After successful setup, all database-dependent services (global settings, plugins, etc.) are automatically initialized and ready to use immediately. No server restart is required.
51
+
52
+
#### API Response
53
+
54
+
The setup endpoint returns a JSON response indicating the success status and whether a restart is required:
55
+
56
+
**Successful Setup (No Restart Required):**
57
+
58
+
```json
59
+
{
60
+
"message": "Database setup successful. All services have been initialized and are ready to use.",
"message": "Database setup successful, but some services may require a server restart to function properly.",
70
+
"restart_required": true
71
+
}
72
+
```
73
+
74
+
In most cases, the setup will complete successfully without requiring a restart. The `restart_required: true` response is a fallback for edge cases where the automatic re-initialization fails.
51
75
52
76
### Database Configuration File
53
77
@@ -181,6 +205,19 @@ You can inspect the SQLite database directly using various tools:
181
205
182
206
## Troubleshooting
183
207
208
+
### Database Setup Issues
209
+
210
+
- **Setup fails with re-initialization error**: If the setup endpoint returns `restart_required: true`, you can manually restart the server to complete the setup process
211
+
- **Database already configured**: If you get a 409 error, the database has already been set up. Use the status endpoint to check the current configuration
212
+
- **Services not working after setup**: Check the server logs for any initialization errors. In rare cases, a manual restart may be needed
213
+
214
+
### Migration Issues
215
+
184
216
- If you get a "table already exists" error, check if you've already applied the migration
185
217
- For complex schema changes, you may need to create multiple migrations
186
218
- To reset the database, delete the `services/backend/persistent_data/database/deploystack.db` file and restart the server
219
+
220
+
### Plugin Issues
221
+
222
+
- **Plugins not working after setup**: Plugins with database extensions should automatically receive database access after setup. Check server logs for plugin re-initialization messages
223
+
- **Plugin database tables missing**: Ensure plugins are properly loaded before database setup, or restart the server if tables are missing
0 commit comments