We're using workbox background sync to handle retrying requests during patchy network connectivity. After the sync is successful, we want a way to indicate to the user that an action has successfully synced. I'm wondering how we can reconcile our redux state with the sync status.
I've noticed that entries in the workbox background sync queue have a metadata property. This seems ideal for performing the reconciliation as we can theoretically put the entity ID in the metadata. The problem I'm facing is how I can set the metadata when performing the initial request. Currently I'm using the fetch API and assuming that the backgroundsync plugin will intercept failed requests.
I can't see a way to set metadata for a request when using the fetch API. Any suggestions?
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
question from:
https://stackoverflow.com/questions/65931804/setting-metadata-for-a-background-sync-request-so-i-can-reconcile-it-with-existi 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…