-
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
Fix regression that causes partial data to be reported unexpectedly in some circumstances #11579
Merged
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
3b90234
Write failing test for issue 11400
jerelmiller 3019c02
Remove properties from test that would pass with fix that arent there
jerelmiller 3432591
Set data to undefined if its partial and we don't allow partial data
jerelmiller 3c3e8fc
Add comment about partial data
jerelmiller 5b1853d
Update test to check for react version
jerelmiller 5d70cd8
Add test to ensure getCurrentResult doesn't have data loss
jerelmiller 1ca66c6
Remove first proposed fix from ObservableQuery
jerelmiller 1d7629d
Remove part of test that performs refetch
jerelmiller 42fea55
Skip reporting result when cache diff is partial and returnPartailDat…
jerelmiller 22355a6
Add changeset
jerelmiller ee92d43
Merge branch 'main' into jerel/issue-11400-unexpected-partial-data
jerelmiller 7ffd17e
Minor tweak to comment
jerelmiller e7fb857
Update size limits
jerelmiller 364ec36
Move check above updateLastDiff
jerelmiller 0e78965
Schedule notification if cache eviction happened
jerelmiller 5cee1db
Remove redundant check
jerelmiller 3c24aa8
Add additional context to comment
jerelmiller 2a624b2
Simplify conditional in test for React 17
jerelmiller d78f1ff
Add check against getCurrentResult to ensure partial data is not set
jerelmiller b497ebd
Remove unnecessary setTimeouts wrapped around simulateResult
jerelmiller ff3c8b1
Merge remote-tracking branch 'origin/main' into jerel/issue-11400-une…
jerelmiller fcf33f2
Update size limits
jerelmiller d4f5bf8
Add additional checks in test to show failed situation
jerelmiller c2afd2a
Account for extra React 17 render
jerelmiller 1e8184b
Conditionally set last diff when we notify
jerelmiller 359a43f
Update size limit
jerelmiller c9b9317
Only schedule notification if not dirty
jerelmiller 73de9f5
Simplify inner conditional to avoid duplicate logic
jerelmiller e5033b5
Restore old if condition
jerelmiller 449b6a2
Add delays to remove React 17 conditional
jerelmiller aa1dbd8
Update size limits
jerelmiller 2896004
Add additional changeset
jerelmiller 1e408bd
Merge branch 'main' into jerel/issue-11400-unexpected-partial-data
jerelmiller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Write failing test for issue 11400
- Loading branch information
commit 3b90234e8862ca8b131bd02467c79980af712775
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
One minor difference with this fix vs prior behavior is that previously the errored
useQuery
would be refetched when the partial data result was written to the cache. Now if the query has errored and we get a partial cache update, no network request happens.I think that's ok as the network request felt a bit surprising, but its also difficult to tell if anyone relies on this "auto refetch" behavior right now.
You can see this particular change in behavior for this test in 1d7629d
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.
Should this be mentioned in the changelog?
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.
Yes, I think it should be mentioned in the changelog.
Maybe add a second changeset to the PR and also classify it as a bug-fix/patch. It's probably better to have as a separate point.
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.
Added! https://github.com/apollographql/apollo-client/pull/11579/files#diff-f06f024af37daf816e4ad94d2d4fcc3ca538945d42bfe30be87cec32bbe0b101