Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Dedupe onError and ensure refetch sets loading state properly #3339

Merged
merged 3 commits into from Aug 10, 2019

Conversation

hwillson
Copy link
Member

@hwillson hwillson commented Aug 10, 2019

This commit helps address 2 main issues:

  1. It prevents the onError callback from unnecessarily being called multiple times in a row.
  2. It migrates all peer and dev deps to use apollo-client 2.6.4. Apollo Client 2.6.4 provides a fix for last result error tracking (apollographql/apollo-client@c44e821), which fixes the long standing React Apollo issue of refetch not setting loading state properly. Calling refetch will now first set loading to true.

These fixes are bundled together, as verifying that onError is working properly requires being able to make sure results after a refetch that don't have an error, are handled properly.

Fixes #3331.
Fixes #3287.
Fixes #2559.
Fixes #321.

(and probably others!)

1. It prevents the `onError` callback from unnecessarily being
called multiple times in a row.

2. It migrates all peer and dev deps to use `apollo-client`
2.6.4. Apollo Client 2.6.4 provides a fix for last result
error tracking
(apollographql/apollo-client@c44e821),
which fixes the long standing React Apollo issue of `refetch`
not setting `loading` state properly. Calling `refetch` will
now first set `loading` to `true`.

These fixes are bundled together, as verifying that `onError`
is working properly requires being able to make sure results
after a refetch that don't have an error, are handled properly.

Fixes #3331.
Fixes #3287.
Fixes #2559.
Fixes #321.

(and probably fixes others!)
@hwillson hwillson merged commit fc08c22 into master Aug 10, 2019
@hwillson hwillson deleted the issue-3287 branch August 10, 2019 20:09
hwillson added a commit that referenced this pull request Aug 13, 2019
Issue #3295 demonstrates a problem where errors aren't maintained
on re-renders, when they should still be available. This issue
was fixed by PR #3339, but this commit will add an extra test to
verify that the issue is indeed fixed.

Fixes #3295.
hwillson added a commit that referenced this pull request Aug 13, 2019
…3362)

* Add test to verify error is persisted on re-render, when appropriate

Issue #3295 demonstrates a problem where errors aren't maintained
on re-renders, when they should still be available. This issue
was fixed by PR #3339, but this commit will add an extra test to
verify that the issue is indeed fixed.

Fixes #3295.

* Changelog update
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant