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
We would like to regularly display the number of pending requests that are parked into workbox queue.
Yes I can use a custom "onSync" function in order to follow the play/replay of the queued items (and thereby increase/decrease an applicative counter), but the problem is that I need to initialize this counter on application/session startup.
I there a "workbox way" to query the workbox queue to get its length ?
(workbox way = not using indexeddb API to access the "request" store of the storage named "workbox-background-sync").
Thx in advance!
The text was updated successfully, but these errors were encountered:
bligny
changed the title
BackgroundSync - get queue length
BackgroundSync - get queue length (WB-V4)
Apr 5, 2019
What about going even further and be able to browse the pending requests to get the details? Something like myQueue.forEach(...). I guess we can use idb to do that (didn't try yet), but it would be cleaner to use the Queue object directly.
Use case:
In our app (used mostly offline) we have a menu entry called "Synchronizing" which display the number of items in queue (using a dedicated counter). It would be nice that a screen could display that list of pending items so that the user will know which one did not reach yet the backend server.
We would like to regularly display the number of pending requests that are parked into workbox queue.
Yes I can use a custom "onSync" function in order to follow the play/replay of the queued items (and thereby increase/decrease an applicative counter), but the problem is that I need to initialize this counter on application/session startup.
I there a "workbox way" to query the workbox queue to get its length ?
(workbox way = not using indexeddb API to access the "request" store of the storage named "workbox-background-sync").
Thx in advance!
The text was updated successfully, but these errors were encountered: