Skip to content
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(graphcache): Re-enable offlineExchange issuing non-cache request policies #3308

Merged
merged 7 commits into from
Jul 19, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Jul 11, 2023

Summary

This PR, when applied, makes two changes.

Primarily, requesdt policies other than cache-first are now allowed in the offlineExchange when re-running failed operations. After rehydration or when replaying failed queries, queries will now not be forced to cache-first policies, and instead use the highest policy that was issued, preferring network policies (cache-only < cache-first < network-only < cache-and-network).

Additionally, instead of checking manually which mutations have made optimistic changes, the cacheExchange will now mark optimistic mutations' contexts with optimistic: true instead.

Set of changes

  • Add OperationContext.optimistic indicating optimistic updates have been made
  • Remove cache-first forcing in offlineExchange
  • Pick highest policy that has been seen in offlineExchange
  • Remove queries from failedQueue that have received a pre-hydration network result

@kitten kitten merged commit 7ddccc1 into main Jul 19, 2023
6 checks passed
@kitten kitten deleted the fix/offline-allow-all-policies branch July 19, 2023 13:23
@github-actions github-actions bot mentioned this pull request Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant