Skip to content

Implement request queue for offline requests with priority #228

@RUKAYAT-CODER

Description

@RUKAYAT-CODER

Background

The app already has requestQueue service. Enhance it to persist requests to AsyncStorage, support priority levels, and batch similar requests during sync. This enables robust offline-first architecture.

Description

Enhance existing request queue to persist offline requests, support priority, and batch during sync.

Current Behavior

Basic in-memory queue loses requests on app crash

Expected Behavior

Requests persisted to AsyncStorage. Priority levels. Batch sync.

Impact

📱 Offline-first architecture
💾 No data loss on app crash
🚀 Efficient batch syncing

Acceptance Criteria

  • Persist requests to AsyncStorage with priority
  • Implement priority levels: critical, high, normal, low
  • Batch similar requests during sync (e.g., multiple PUTs to same endpoint)
  • Resume queue on app restart
  • Test offline scenarios with network simulation
  • Monitor queue status in analytics
  • Document queue priority strategy

Implementation Hints

Use requestQueue service. Add persistence layer with AsyncStorage. Use priority queues (e.g., heap structure). Batch on reconnection.

Performance Metrics

Before:

  • dataLossOnCrash: All queued requests lost

After (Target):

  • dataLossOnCrash: Requests persisted and synced on restart

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions