What's the bug?
When a database record is modified via the PostgREST proxy endpoint (backend/src/api/routes/database/records.routes.ts), the backend is supposed to broadcast a DATA_UPDATE socket event so the dashboard data grid can instantly refresh.
However, the socket broadcast logic explicitly ignores PATCH and PUT requests
Because PATCH and PUT are omitted, any updates made to existing rows do not trigger a real-time UI refresh for other connected admins. The data grid becomes stale and requires a manual page reload to see the changes.
(Note: The bespoke admin.routes.ts endpoint does correctly broadcast this event for router.patch, confirming this is an unintended omission in records.routes.ts.)
// backend/src/api/routes/database/records.routes.ts
// Broadcast socket events for mutations
if (['POST', 'DELETE'].includes(method)) {
const socket = SocketManager.getInstance();
// ... socket.broadcastToRoom('role:project_admin', ServerEvents.DATA_UPDATE, ...)
}
### How to reproduce
### How to reproduce
```markdown
1. Open the InsForge dashboard and navigate to a database table's Data Grid view in two separate browser windows (simulating two active admins).
2. In Window A, edit a field on an existing record and save it (this fires a `PATCH` request).
3. Observe Window B. The data grid will not update automatically to reflect the edit.
4. Manually refresh Window B to finally see the updated data.
### Environment (optional)
- **OS:** All
- **Browser:** All
- **Version:** Latest `main`
What's the bug?
When a database record is modified via the PostgREST proxy endpoint (
backend/src/api/routes/database/records.routes.ts), the backend is supposed to broadcast aDATA_UPDATEsocket event so the dashboard data grid can instantly refresh.However, the socket broadcast logic explicitly ignores
PATCHandPUTrequestsBecause PATCH and PUT are omitted, any updates made to existing rows do not trigger a real-time UI refresh for other connected admins. The data grid becomes stale and requires a manual page reload to see the changes.
(Note: The bespoke admin.routes.ts endpoint does correctly broadcast this event for router.patch, confirming this is an unintended omission in records.routes.ts.)