Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscription store fixes #1593

Merged
merged 3 commits into from
Jan 22, 2025
Merged

Subscription store fixes #1593

merged 3 commits into from
Jan 22, 2025

Conversation

AaronPlave
Copy link
Contributor

@AaronPlave AaronPlave commented Jan 15, 2025

Refactors gql subscription store so that the store only maintains a single subscription to the query within the web socket instead of N subscriptions where N is the number of files that the store is used within. This removes redundant subscriptions which could potentially cause performance issues in many cases. Note that the debugging of this code was difficult and that the current solution relies on debounce the creation of new subscriptions since the underlying graphql websocket library seems to not always be able to immediately execute unsubscribe calls which can cause duplication of queries and in some cases unsubscription from the incorrect queries.

Closes #1464.

@AaronPlave AaronPlave requested a review from duranb January 15, 2025 17:59
@AaronPlave AaronPlave force-pushed the fix/1464/subscription-fixes branch from b20b724 to 1985a19 Compare January 17, 2025 16:20
@AaronPlave AaronPlave marked this pull request as ready for review January 17, 2025 16:20
@AaronPlave AaronPlave requested a review from a team as a code owner January 17, 2025 16:20
@AaronPlave AaronPlave self-assigned this Jan 17, 2025
src/stores/subscribable.ts Outdated Show resolved Hide resolved
@AaronPlave AaronPlave changed the title Fix/1464/subscription fixes Subscription store fixes Jan 21, 2025
@AaronPlave AaronPlave force-pushed the fix/1464/subscription-fixes branch from 55fe331 to c580687 Compare January 21, 2025 20:27
Copy link
Collaborator

@duranb duranb left a comment

Choose a reason for hiding this comment

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

Works great!

@AaronPlave
Copy link
Contributor Author

Works great!

🤞

@AaronPlave AaronPlave force-pushed the fix/1464/subscription-fixes branch from c580687 to b60a4df Compare January 22, 2025 14:57
@AaronPlave AaronPlave force-pushed the fix/1464/subscription-fixes branch from b60a4df to b5e7a81 Compare January 22, 2025 16:10
@AaronPlave AaronPlave merged commit 4b442be into develop Jan 22, 2025
5 checks passed
@AaronPlave AaronPlave deleted the fix/1464/subscription-fixes branch January 22, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

double subscribing on certain hasura queries
2 participants