We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91430ef commit 0730b40Copy full SHA for 0730b40
sdk/src/accounts/webSocketAccountSubscriberV2.ts
@@ -93,6 +93,16 @@ export class WebSocketAccountSubscriberV2<T> implements AccountSubscriber<T> {
93
94
private async handleNotificationLoop(subscription: AsyncIterable<any>) {
95
for await (const notification of subscription) {
96
+ // If we're currently polling and receive a WebSocket event, stop polling
97
+ if (this.pollingTimeoutId) {
98
+ if (this.resubOpts?.logResubMessages) {
99
+ console.log(
100
+ `[${this.logAccountName}] Received WebSocket event while polling, stopping polling`
101
+ );
102
+ }
103
+ this.stopPolling();
104
105
+
106
if (this.resubOpts?.resubTimeoutMs) {
107
this.receivingData = true;
108
clearTimeout(this.timeoutId);
0 commit comments