Skip to content

Follow-ups from #64: dashboard live events, TestQueue cron rescheduling, MySQL archive deadlock flake #71

Closed

Description

@CodingAnarchy

Loose ends reported while fixing #64. None was in that issue's scope.

  1. The dashboard WebSocket never receives server events. W1 (fix(web): harden dashboard auth, CSRF, request limits and WebSockets (#64 H5, H6, H7, H8, M11, M12, M13, M16) #66) bounded WebSocket memory and fixed subscriptions, but no server code ever publishes job or queue events to connected clients. The dashboard's live updates therefore never fire. Bridge the library's EventManager (job lifecycle events) to WebSocketState broadcasts, honouring each client's subscriptions. Add tests that subscribe a client and assert it receives an event when a job completes.
  2. TestQueue cron rescheduling diverges from the database backends. After a recurring job runs, TestQueue creates a new job for the next occurrence, while PostgreSQL and MySQL reschedule the same row (same id). Code tested against TestQueue can therefore depend on behaviour it won't get in production. Make TestQueue reschedule in place, and add a generic test over all three backends.
  3. MySQL flake: test_mysql_archive_and_restore_keep_ciphertext deadlocked once (1213) while both backends' suites ran at the same time. Archive/restore on MySQL should retry on deadlock like the claim path does (retry_on_deadlock), or take its row locks in a consistent order.
  4. One undecodable row breaks the dashboard job search with a 500. A leftover row with timeout_seconds = -1 did this. fix(queue): store job timeouts without truncating or wrapping #70 stops new negative timeouts from being written. Listing endpoints should still skip and log rows they can't decode, instead of failing the whole page; single-job reads should keep returning the error.

Part of #7.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions