BackgroundSync, from workbox, works perfectly but I have a problem
I want that when I modify an element, even if the request is still in indexedDB, the element is not updated on my pwa (UI), when I am offline. For now, when I change the element ( in a simple input), the request is in my indexedDB, and if I refresh the page, it gets back as before. When I have network again, the request is sent and the element is updated in the UI
I use workbox V6 for my worker service, and a PHP API to modify my elements this is the part of my service worker for sync :
const bgSyncPlugin = new BackgroundSyncPlugin('offlineSyncQueue', {
maxRetentionTime: 0.1 * 60
});
registerRoute(
/http:\/\/localhost:3001/,
new NetworkFirst({
plugins: [bgSyncPlugin]
})
);
Can you help me, please