[Infra] Message queue / offline buffer for Workshop panel #913

Closed
opened 2026-03-22 13:24:01 +00:00 by Timmy · 2 comments
Owner

Problem

When the Hermes API backend is unreachable (Mac offline, VPS restart, network blip), messages sent from the Workshop panel are lost. The user gets no feedback, and Timmy never sees the message.

Solution

Add an offline message queue so that:

  1. Frontend (panel.js): If the API returns an error or times out, store the message in localStorage with a timestamp
  2. Frontend retry: On reconnection (periodic health check), replay queued messages in order
  3. VPS-side queue (optional): nginx or a small service buffers POST requests when upstream is down, replays when it comes back
  4. User feedback: Show "queued" status on messages that haven't been delivered yet, with a visual indicator

Scope

  • Add localStorage message queue in panel.js
  • Add connection health check (ping endpoint every 30s)
  • Show queued/delivered/failed status per message
  • Replay queued messages on reconnection
  • Optional: VPS-side queue service (Redis or SQLite buffer)

Priority

High — complements the VPS migration. Even with Hermes on VPS, there will be restarts and brief outages. Messages should never be silently lost.

## Problem When the Hermes API backend is unreachable (Mac offline, VPS restart, network blip), messages sent from the Workshop panel are lost. The user gets no feedback, and Timmy never sees the message. ## Solution Add an offline message queue so that: 1. **Frontend (panel.js):** If the API returns an error or times out, store the message in `localStorage` with a timestamp 2. **Frontend retry:** On reconnection (periodic health check), replay queued messages in order 3. **VPS-side queue (optional):** nginx or a small service buffers POST requests when upstream is down, replays when it comes back 4. **User feedback:** Show "queued" status on messages that haven't been delivered yet, with a visual indicator ## Scope - [ ] Add `localStorage` message queue in `panel.js` - [ ] Add connection health check (ping endpoint every 30s) - [ ] Show queued/delivered/failed status per message - [ ] Replay queued messages on reconnection - [ ] Optional: VPS-side queue service (Redis or SQLite buffer) ## Priority **High** — complements the VPS migration. Even with Hermes on VPS, there will be restarts and brief outages. Messages should never be silently lost.
claude was assigned by Rockachopa 2026-03-22 23:31:57 +00:00
Collaborator

📋 Triage: Infrastructure — Deprioritized

Dashboard/UI layer. The harness is the product — dashboard work is secondary.

Ref: #1076

📋 **Triage: Infrastructure — Deprioritized** Dashboard/UI layer. The harness is the product — dashboard work is secondary. Ref: #1076
claude added the deprioritizedinfrastructure labels 2026-03-23 13:56:21 +00:00
Collaborator

PR created: #1205

Implemented the full frontend offline queue:

  • queue.js: New localStorage-backed queue with QUEUED/DELIVERED/FAILED status and 24h auto-expiry
  • state.js: 30-second health-check polling /api/matrix/health, WebSocket auto-reconnect, onConnectionChange listener
  • index.html: Job submissions now queue on network failure (instead of fake-success); queued jobs replay automatically on reconnection; amber pulsing badge shows pending count across page loads
  • style.css: Queued state panel with clock icon and amber palette

VPS-side queue (Redis/SQLite buffer) was marked optional in the issue and deferred — the localStorage approach handles all the stated scenarios.

PR created: #1205 Implemented the full frontend offline queue: - **`queue.js`**: New localStorage-backed queue with QUEUED/DELIVERED/FAILED status and 24h auto-expiry - **`state.js`**: 30-second health-check polling `/api/matrix/health`, WebSocket auto-reconnect, `onConnectionChange` listener - **`index.html`**: Job submissions now queue on network failure (instead of fake-success); queued jobs replay automatically on reconnection; amber pulsing badge shows pending count across page loads - **`style.css`**: Queued state panel with clock icon and amber palette VPS-side queue (Redis/SQLite buffer) was marked optional in the issue and deferred — the localStorage approach handles all the stated scenarios.
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#913