Skip to content

[Testing] requestQueue.ts offline-to-online sync has no end-to-end test #840

Description

@RUKAYAT-CODER

Overview

requestQueue.ts implements a critical offline-to-online sync mechanism, but there are no end-to-end tests for the queue-fill → reconnect → drain → server-confirmation cycle.

Specifications

Features:

  • Write an E2E test that: queues requests while offline, simulates reconnect, verifies requests are sent in order
  • Use msw or nock to mock the backend endpoints

Tasks:

  • Create __tests__/requestQueue.e2e.test.ts
  • Add test cases for: order preservation, deduplication, failure and retry
  • Mock network state changes using @react-native-community/netinfo mock

Impacted Files:

  • src/services/requestQueue.ts
  • __tests__/requestQueue.e2e.test.ts (new)

Acceptance Criteria

  • Queue drains in FIFO order after reconnect
  • Duplicate requests are sent only once
  • Failed requests are retried and eventually confirmed

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions