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
Summary
This PR, when applied, makes two changes.
Primarily, requesdt policies other than
cache-first
are now allowed in theofflineExchange
when re-running failed operations. After rehydration or when replaying failed queries, queries will now not be forced tocache-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 withoptimistic: true
instead.Set of changes
OperationContext.optimistic
indicating optimistic updates have been madecache-first
forcing inofflineExchange
offlineExchange
failedQueue
that have received a pre-hydration network result