Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d81a184
WIP
raluik May 14, 2026
8a07e0a
Cleanup
raluik May 14, 2026
aa4fab1
Refactor to remove unnecessary steps
raluik May 14, 2026
a26644b
Add exponential backoff
raluik May 14, 2026
b926a0e
Improve JS docs formatting
raluik May 14, 2026
f8a6aae
Simplify
raluik May 14, 2026
fd52a21
Cleanup
raluik May 14, 2026
333ce7d
Improve JSDoc
raluik May 14, 2026
6e7f612
Add subscription retry limit
raluik May 14, 2026
31eb44e
Log unhandled promise errors
raluik May 14, 2026
c9e850b
Improve log
raluik May 15, 2026
d71deb0
Remove console logs
raluik May 19, 2026
1827631
Improve types
raluik May 19, 2026
f865ac1
Fix unit tests
raluik May 19, 2026
48944a7
Improve test descriptions
raluik May 19, 2026
1262507
Add tests
raluik May 19, 2026
87cc500
Improve tests
raluik May 19, 2026
130df8d
Add unit tests
raluik May 19, 2026
1511da7
Move tests
raluik May 19, 2026
39922b2
Cleanup
raluik May 19, 2026
0411062
Fix unit tests
raluik May 19, 2026
6e0a54a
Fix types
raluik May 19, 2026
89b6652
Fix formatting
raluik May 19, 2026
1c99282
Retry only retryable errors
raluik May 19, 2026
6f38b07
Clean up completed subscription
raluik May 19, 2026
a36ff40
Cleanup
raluik May 19, 2026
c23cad1
Revert changes
raluik May 19, 2026
11bd4b9
Revert change
raluik May 19, 2026
8dcfd30
Fix typo
raluik May 19, 2026
c27282a
Fix retry counts
raluik May 19, 2026
38d421a
Revert changes
raluik May 19, 2026
6b70a49
Increase retry count
raluik May 19, 2026
46f7323
Revert changes
raluik May 21, 2026
19d3cdd
Add optional chaining
raluik May 21, 2026
a30ae99
Revert changes
raluik May 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-env jest */

import { DocumentNode } from 'graphql';
import { DocumentNode, print } from 'graphql';
import WS from 'jest-websocket-mock';
import { DeserializedMessage } from 'jest-websocket-mock/lib/websocket';
import { lastValueFrom, Observer, Subscription, take } from 'rxjs';
import { lastValueFrom, Observer, Subscriber, Subscription, take } from 'rxjs';

import { ConnectionStatus } from '../../../model/connection-status';
import { GraphqlService } from '../graphql.service';

Expand All @@ -23,7 +24,7 @@ export class GraphQLSubscriptionsFixture {
.mockReturnValue(SERVER_URL);

jest
.spyOn(this.graphqlService as any, 'fetchTemporaryApiKey')
.spyOn(this.graphqlService as any, 'getTemporaryApiKey')
.mockResolvedValue(DUMMY_API_KEY);
}

Expand All @@ -40,12 +41,8 @@ export class GraphQLSubscriptionsFixture {
return (this.graphqlService as any).subscriptions.length;
}

getGraphqlServiceSubscriptionObserverMapSize(): number {
return Object.keys(this.getGraphqlServiceSubscriptionObserverMap()).length;
}

getGraphqlServiceSubscriptionObserverMap(): Record<string, Observer<object>> {
return (this.graphqlService as any).subscriptionObserverMap;
getMessagesSubscribers(): Map<string, Subscriber<Record<string, any>>> {
return this.graphqlService['messagesSubscribers'];
}

async waitForConnection() {
Expand Down Expand Up @@ -99,11 +96,12 @@ export class GraphQLSubscriptionsFixture {

async consumeSubscribeMessage(
query: DocumentNode | string = 'subscription { baba }',
{ id }: { readonly id: string } = { id: '1' },
) {
expect(await this.server.nextMessage).toEqual({
id: '1',
id,
type: 'start',
payload: { query },
payload: { query: typeof query === 'string' ? query : print(query) },
});
}

Expand Down
Loading
Loading