-
Notifications
You must be signed in to change notification settings - Fork 786
Update lastResult whenever data changes to ensure components re-rende… #2840
Conversation
…r if result is set back to original lastResult
@Glennrs: 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/ |
Thanks for submitting this PR @Glennrs. We can't accept this PR as it stands currently, as we have no way to verify that it's fixing a problem. A test showing what this fixes (to help avoid regressions), or a small runnable reproduction that demonstrates how this is a problem, would definitely help. I'll close this for now, but to help push the discussion forward, I'd suggest opening a new issue with as many details as you can provide that shows how this is a problem. Once we've been able to confirm this is an issue, we'll then be ready to accept a PR. Thanks! |
The following Gist has a repro for the issue. You can see that after the Query component has its properties updated, it will set lastResult to true and subsequently always early out when the value is set back to true again (meaning it remains in a state where it renders false). https://gist.github.com/Glennrs/8051fcac26ec50a8d113cf4e4586769c |
Re-opening as this issue has been demonstrated by the reproduction in #2887. I'll add a regression test, then get this merged. |
Base on the reproduction provided in apollographql#2887.
I've updated the original PR message to reference a few issues this will help fix, but I'm sure there are others that this will help with (either directly or indirectly), like #1931. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All systems go here @Glennrs - thanks very much!
@hwillson when are you guys planning to release this? is it going to be just a patch version? |
also hoping to test this out! |
update: maybe a good time to give a shout out to all the contributors on this project. |
I've been unable to write a test case to reproduce this scenario, however, the logic is fairly simple to follow. I'm happy to be informed if I'm missing something and this PR is not required. Scenario is:
This PR ensures that lastResult is updated if set, when new data is available.
Fixes #2857.
Fixes #2887.