-
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
Call iterateObserversSafely
if vars change between calls to observer.next
#10143
Conversation
3e3d33f
to
31cecd6
Compare
86bcb6c
to
8412af2
Compare
94a73f1
to
15e8020
Compare
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.
I think we can simplify this a bit, and avoid introducing a new public method to the ObservableQuery
class, which is a public API. Comments below!
c1069de
to
94256e6
Compare
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.
Looks good to me, thanks @alessbell. Please drop a note in CHANGELOG.md
(in a new section for 3.7.1) and merge away!
Closes #10105.
This PR updates the condition inside of
src/core/ObservableQuery.ts
'sreportResult
to check whether an observable query's variables have changed in between calls toobserver.next
. This resolves the linked issue: whenloading
remainstrue
afterobserver.refetch
is called multiple times with different variables when the same data are returned.Previously, this would result in the
lastError || this.isDifferentFromLastResult(result)
check returning false, anditerateObserversSafely
would not execute with the newresult
containingloading: false
.Checklist: