Skip to content

fix(graphql): Consume streams from offline graphql requests#617

Merged
tshedor merged 1 commit intoGetDutchie:mainfrom
elbieds:fix-consume-streams-from-offline-graphql-requests
Jul 3, 2025
Merged

fix(graphql): Consume streams from offline graphql requests#617
tshedor merged 1 commit intoGetDutchie:mainfrom
elbieds:fix-consume-streams-from-offline-graphql-requests

Conversation

@elbieds
Copy link
Contributor

@elbieds elbieds commented Jul 3, 2025

Problem
GraphQL requests via the offline queueing system were not reaching the servers because the request streams were not being consumed.

Root Cause
The transmitRequest method in GraphqlOfflineRequestQueue was calling link.request(request) without consuming the returned stream.

Testing

  1. Stream consumption test: Verifies that streams are properly consumed using Stream.eventTransformed to track when the stream is listened to
  2. Error handling test: Ensures error streams are also consumed properly

Validation
Previously:

% dart test test/graphql_offline_request_queue_test.dart
00:00 +2 -1: GraphqlOfflineRequestQueue Request Processing #transmitRequest [E]                                           
  Expected: true
    Actual: <false>

00:00 +2 -2: GraphqlOfflineRequestQueue Request Processing #transmitRequest with errors [E]                               
  Expected: throws <Instance of 'Exception'>
    Actual: <Closure: () => Future<void>>

With the fix:

% dart test test/graphql_offline_request_queue_test.dart
00:00 +4: All tests passed!

Copy link

@UrsDeSwardt UrsDeSwardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@tshedor tshedor changed the title Fix: Consume streams from offline graphql requests fix(graphql): Consume streams from offline graphql requests Jul 3, 2025
@tshedor tshedor merged commit 37e6c67 into GetDutchie:main Jul 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants