-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
reset last results on new observer subscribe #2871
Conversation
@roycclu: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
Danger has erroredError: TypeError TypeError: Cannot read property 'login' of null
at Object.<anonymous>.commits.map.x (dangerfile.ts:45:43)
at Array.map (<anonymous>)
at Object.<anonymous> (dangerfile.ts:45:25)
at Runtime._execModule (/home/circleci/project/node_modules/jest-runtime/build/index.js:513:13)
at Runtime.requireModule (/home/circleci/project/node_modules/jest-runtime/build/index.js:329:14)
at /home/circleci/project/node_modules/danger/distribution/runner/DangerfileRunner.js:133:33
at ensureCleanDangerfile (/home/circleci/project/node_modules/danger/distribution/runner/DangerfileRunner.js:173:5)
at Object.<anonymous> (/home/circleci/project/node_modules/danger/distribution/runner/DangerfileRunner.js:132:21)
at step (/home/circleci/project/node_modules/danger/distribution/runner/DangerfileRunner.js:32:23)
at Object.next (/home/circleci/project/node_modules/danger/distribution/runner/DangerfileRunner.js:13:53) Generated by 🚫 dangerJS |
@roycclu what is the goal with this? |
@jbaxleyiii solving issue #2774 #2513 |
Could be totally mistaken, but I believe this addresses apollographql/react-apollo#1385 as well! Any reason why this hasn't gone in yet? Thanks everyone! |
@jbaxleyiii There are a ton of issues about this both at this repo and #2513 I'm sure there are more out there. It's a very critical issue. And people are coming up with quick patches and alternative packages. I don't know if this is the actual solution to the problem, but I'm respectfully surprised at your question. |
@nfantone all of those issues should be fixed with the new react apollo. The QueryRecycler was a nightmare that made a ton of issues like this a problem. As for in Apollo Client, the question to me is should we resetResults when new subscribers add on. I don't think so. A simple case shows where this is a problem: client.watchQuery({ query )).subscribe((data) => {
// when we have data, create a new subscription (its like mounting a sub component)
client.watchQuery({ query }).subscribe((result) => {
// why would this reset the last results since its just a cache read
});
}); What I would love to see here for a core change is a failing test showing the behavoir that isn't working currently or a reproduction with the latest updates showing this is still a problem. I'll work next week to hit those issues (THANK YOU for listing them here) to see if they are fixed in the new releases
Wearing the community member hat, I totally understand this! As the primary maintainer, I'd love some empathy here as our team is incredibly small (but growing) and keeping on top of everything is sooo hard. I really appreciate your feedback and the contributions here and am trying to keep up I promise 👍 |
Thanks for contributing this PR @roycclu! As mentioned in #2871 (comment), a lot (maybe all) of the issues listed in this thread should now be fixed, with recent versions of |
@hwillson Is this released on NPM, because i'm still facing this issue, These are the latest packages i'm using:
|
@sjnonweb these versions fixed for me, just a note make sure you have apollo-client 2.3.7 in node modules edit: sorry this didn't fix, a error() was thrown un intentionally which was caught by error handler which uses the same error representation component I was mistaken. Surprisingly, error() thrown will achieve the desired behavior graphql errors are reset and the query resulted in error when executed resolves on network again. |
@hwillson I also dont see this code on master can you please confirm on which version is this deployed on |
Checklist: