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

Un-revert "Improve (and shorten) query polling implementation. (#4243)" #4337

Merged
merged 2 commits into from
Jan 22, 2019

Conversation

benjamn
Copy link
Member

@benjamn benjamn commented Jan 19, 2019

This reverts commit 9739ff6.

Now that we have a uniform interface for terminating ApolloClient instances (#4336), there should be no need for any external code to access the QueryScheduler abstraction, which this commit removes.

We should wait to merge and release this change until after apollographql/react-apollo#2741 has been merged and released, so that we don't break older versions of MockedProvider.

@benjamn benjamn self-assigned this Jan 19, 2019
@benjamn benjamn requested a review from hwillson January 19, 2019 00:56
@benjamn

This comment has been minimized.

Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

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

Thanks @benjamn!

@benjamn benjamn force-pushed the un-revert-QueryScheduler-removal branch from 47ac099 to 3e8d0e8 Compare January 22, 2019 17:30
}

private stopQueryInStoreNoBroadcast(queryId: string) {
this.stopPollingQuery(queryId);
Copy link
Member Author

Choose a reason for hiding this comment

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

It seems pretty obvious that we should stop polling a query when we call stopQuery for that query.

@@ -955,7 +960,12 @@ export class QueryManager<TStore> {
}

public stopQuery(queryId: string) {
this.stopQueryInStore(queryId);
this.stopQueryNoBroadcast(queryId);
this.broadcastQueries();
Copy link
Member Author

@benjamn benjamn Jan 22, 2019

Choose a reason for hiding this comment

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

This now waits to call this.broadcastQueries() until after the query has been removed, whereas previously this.stopQueryInStore(queryId) would stop the query, call this.broadcastQueries(), then return control to stopQuery, which would finally call this.removeQuery(queryId).

It makes more sense to me to wait until the query has been removed to broadcast queries, but I'm not sure if this semantic subtlety was important before.

@benjamn
Copy link
Member Author

benjamn commented Jan 22, 2019

@hwillson I still think this should be part of a minor version bump for apollo-client, so maybe we should wait to merge it until we're ready to release 2.5.0 otherwise?

@hwillson
Copy link
Member

@benjamn Agreed! Let's get this out with 2.5.0. Thanks!

benjamn added a commit that referenced this pull request Jan 22, 2019
@benjamn benjamn changed the base branch from master to release-2.5.0 January 22, 2019 23:38
This reverts commit 9739ff6.

Now that we have a uniform interface for terminating ApolloClient
instances (#4336), there should be no need for any external code to access
the QueryScheduler abstraction, which this commit removes.

We should wait to merge and release this change until after
apollographql/react-apollo#2741 has been merged
and released, so that we don't break older versions of MockedProvider.
@benjamn benjamn force-pushed the un-revert-QueryScheduler-removal branch from 9eba27e to a94c2aa Compare January 22, 2019 23:47
@benjamn benjamn merged commit e399ad8 into release-2.5.0 Jan 22, 2019
@benjamn benjamn deleted the un-revert-QueryScheduler-removal branch January 22, 2019 23:49
@benjamn benjamn added this to the Release 2.5.0 milestone Jan 22, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants