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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

recycled query teardown #740

Merged
merged 6 commits into from Jun 2, 2017

Conversation

Projects
None yet
3 participants
@jbaxleyiii
Copy link
Member

jbaxleyiii commented Jun 1, 2017

Fix for #718, #667, and probably a lot of other loading issues by removing the current subscription before recycling the observable

I'm going to add a test in the morning for this, but for all those impacted, this will be released tomorrow after the flow PR is released in AC. 馃憤

TODO:

  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass
  • Update CHANGELOG.md with your change

James Baxley added some commits Jun 1, 2017

@jbaxleyiii jbaxleyiii changed the title 780 718 Jun 1, 2017

@jbaxleyiii jbaxleyiii changed the title 718 recycled query teardown Jun 1, 2017

@jbaxleyiii jbaxleyiii requested a review from helfer Jun 1, 2017

@jbaxleyiii jbaxleyiii self-assigned this Jun 1, 2017

@helfer
Copy link
Member

helfer left a comment

We should make sure to check that this still does what the recycling was intended for. If I'm not mistaken, the observable might actually be torn down as soon as it has zero subscribers, which is why the recycler adds a subscriber of its own. Do we have tests for the recycling behavior?

@jbaxleyiii

This comment has been minimized.

Copy link
Member Author

jbaxleyiii commented Jun 1, 2017

@helfer we do have tests, but I'm going to work to improve them some. I think this change isn't the full fix we want and may require apollo-client changes. With this change, on remount you get a loading state then the data. Ideally it shouldn't pass loading state.

One question for thought though:
If you contents from your query, is the query loading? If data means no loading, then we could return loading unless we have the data in which case we could set loading to false

@jbaxleyiii

This comment has been minimized.

Copy link
Member Author

jbaxleyiii commented Jun 1, 2017

This will fail until apollo-client PR is approved and released

James Baxley

@jbaxleyiii jbaxleyiii merged commit ddd3d8f into master Jun 2, 2017

5 checks passed

./dist/index.min.js.gz +7 bytes (+0.06%) 鈫 11,516 bytes
CLA Author has signed the Meteor CLA.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 92.219%
Details

@jbaxleyiii jbaxleyiii deleted the 780 branch Jun 2, 2017

@munyirik

This comment has been minimized.

Copy link

munyirik commented Sep 22, 2018

@jbaxleyiii could you point me to the commit or PR in apollo-client that coincided with this fix? I'm running into #667 on an apollo-client fork. I'm hoping I can apply the same fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment