Fix "Unexpected end of JSON input" error by:
- Check for empty/whitespace-only body before parsing
- Return empty object for empty bodies instead of failing
- Add detailed error logging for debugging JSON parse failures
- Prevent crashes on malformed or empty request bodies
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Update GitHub disconnect endpoint to also remove user avatar:
- Clear avatar field in database (set to Prisma.JsonNull)
- Include avatar removal in account update broadcast
- Update logging to reflect avatar removal
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add DELETE /v1/connect/github endpoint to disconnect GitHub accounts by:
- Deleting GitHub user token from database
- Removing account link (githubUserId = null)
- Broadcasting disconnect event to connected clients
- Using database transaction for atomicity
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Clean up machine API endpoints formatting
- Update machine-alive to use ephemeral events instead of updates
- Prepare types for separated metadata and daemonState
- Fix activeAt field name consistency in machine responses
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Machine-alive handler now properly emits update events to all user connections
- Ensures mobile clients receive real-time machine status updates
- Fixed null handling when machine doesn't exist in database
Note: Last test was not able to spawn new session - webhook callback timing issue
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Consistent naming with the update body type (t: 'update-machine')
- Shorter and cleaner event name
- Matches the pattern used elsewhere in the codebase
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The mode parameter is not used by the server, only tracked client-side.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove SessionAliveEvent type and simplify event handling
- session-alive now only handles session heartbeats (requires sid)
- Add new machine-alive event for daemon heartbeats (requires machineId)
- Remove type field and coupling between session and machine events
- Add proper TypeScript types instead of using 'any'
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
• Add Machine model to Prisma schema
• Create /v1/machines endpoints for CRUD operations
• Persist machine metadata and track active status
• Update socket handlers for machine-scoped connections
• Convert ephemeral machine status to database persistence
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>