Skip to content

feat(frontend): offline-aware API queue for retryable actions (#241)#298

Open
Shikhar-404exe wants to merge 1 commit into
utksh1:mainfrom
Shikhar-404exe:241
Open

feat(frontend): offline-aware API queue for retryable actions (#241)#298
Shikhar-404exe wants to merge 1 commit into
utksh1:mainfrom
Shikhar-404exe:241

Conversation

@Shikhar-404exe
Copy link
Copy Markdown

@Shikhar-404exe Shikhar-404exe commented May 24, 2026

Offline-Aware Queue System #241

Adds offline support for retryable write actions by queueing requests during connectivity loss and replaying them automatically when the connection returns.

Highlights

  • Added offlineQueue.ts service with:
    • enqueue
    • retry
    • retryAll
    • remove
    • clear
    • subscribe
  • Persists queue state in localStorage
  • Detects online/offline changes automatically

React Integration

Added OfflineQueueContext.tsx to provide:

  • isOnline
  • pendingCount
  • queue
  • queue action handlers

Integrated globally using <OfflineQueueProvider>.

API Changes

Enhanced request<T>() with:

  • retryable
  • label

Retryable mutations are queued while offline and replayed later.

Supported actions:

  • startTask
  • deleteTask
  • bulkDeleteTasks
  • clearAllTasks
  • cancelTask
  • createWorkflow
  • runWorkflow
  • updateWorkflow
  • deleteWorkflow

Read-only GET requests remain non-retryable.

UI

Added OfflineQueueIndicator in Sidebar.tsx featuring:

  • Offline status indicator
  • Pending queue count
  • Queue dropdown
  • “Retry All” action
  • Individual item removal

Testing

Added comprehensive coverage:

  • 17 queue service tests
  • 7 context tests
  • 15 API offline integration tests

…#241)

- Queue service: enqueue, retry(id), retryAll, remove, clear,
  persist to localStorage, auto-replay on reconnect
- React context provider wrapping queue service with isOnline,
  pendingCount, queue state
- API integration: all 9 mutating functions (startTask, deleteTask,
  bulkDeleteTasks, clearAllTasks, cancelTask, createWorkflow,
  runWorkflow, updateWorkflow, deleteWorkflow) tagged retryable,
  enqueue when offline instead of failing
- Sidebar indicator: cloud_off/cloud_sync icon, pending count badge,
  dropdown with item list and Retry All button
- 17 service tests, 7 context tests, 15 API integration tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant