You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
Offline requests block promises.
This will mean that code in then will never be called until the device becomes online.
return this.apollo.mutate<Task>().then((retry)=>{
// Never called when offline.
// This will be resolved only when online
}).catch((error)=>{
// Never called when offline
// This will be resolved only when online
});
Proposal 1
Return error when change is enqueued offline and resubmit every change using client.
return this.apollo.mutate<Task>().then((retry)=>{
// Never called when offline.
// This will be resolved only when online
}).catch((error)=>{
if(error.conflict){
// User will get error with conflict
}
});
Proposal 2
Return another observable or promise in error
return this.apollo.mutate<Task>().then((retry)=>{
// Never called when offline.
// This will be resolved only when online
}).catch((error)=>{
if(error.offlinePromise){
offlinePromise.then((data)=>{
// Will be called when we become back online
});
}
});
The text was updated successfully, but these errors were encountered:
Definition of the problem
Offline requests block promises.
This will mean that code in then will never be called until the device becomes online.
Proposal 1
Return error when change is enqueued offline and resubmit every change using client.
Proposal 2
Return another observable or promise in error
The text was updated successfully, but these errors were encountered: