Questions tagged [background-sync]
61 questions
1
vote
1 answer
Workbox 4.1 backgroundSync: Queue and Plugin
I need to fetch a token before I can proceed with the background sync, then I'll loop the queue, build a new Request with the token added to the headers and send it.
I'm using the Plugin to register the data submitted offline and it's being…

UselessNPC
- 13
- 6
1
vote
2 answers
Background Sync not triggering automatically
Ok, so I'm trying to make an Angular 7 PWA that uses background sync.
I can trigger the sync event from within the dev tools in Chromium but it won't trigger when I remove my ethernet cable and plug it back in.
I originally thought it was my service…

nichh
- 41
- 4
1
vote
1 answer
Background Sync with Workbox in Vue
I am trying to make a background-sync request with WorkBox, in a very simple example application with Vue. I revised my codes for a long time but I did not find the solution, or maybe, something is wrong in my code.
The service worker is well…

asiermusa
- 160
- 1
- 9
1
vote
1 answer
Duplicate post request sent by Service Worker
I just found this issue because I was trying to solve the duplicate post request issue when I am using workbox-background-sync. There is a function of my web app to upload the photos. But every time I did uploaded twice to the database. Here is the…

wadefanyaoxia
- 597
- 1
- 8
- 21
1
vote
0 answers
Service worker sync event fires immediately
I am using Chrome 66.0.3359.181 (64-bit). I am running the following code:
navigator.serviceWorker.ready
.then(sw=>{
addData('sync-posts',post)
.then(()=>{
return sw.sync.register('sync-new-posts');
})
.then(()=>{
var…

user2047485
- 391
- 5
- 20
1
vote
1 answer
Workbox Service Worker with Background Sync module
I've been using Workbox for a few days and i correctly set it up for generating a service worker from a source and dont let Workbox generate it for me.
It works ok but now im trying to include the workbox-background-sync module for storing some…

Conrad
- 57
- 1
- 8
1
vote
2 answers
Service worker sync fires only the first time
On button click I successfully register for sync and it fires the functionality I've described in the service-worker.
If I'm offline - it waits for the browser to get connection and then it fires.
BUT - when I click the button the first time and all…

pesho hristov
- 1,946
- 1
- 25
- 43
1
vote
2 answers
Pass custom data to service worker sync?
I need to make a POST request and send some data. I'm using the service worker sync to handle offline situation.
But is there a way to pass the POST data to the service worker, so it makes the same request again?
Cause apparently the current…

pesho hristov
- 1,946
- 1
- 25
- 43
0
votes
0 answers
Requests getting lost in Workbox Queue
I have a PWA that is used to send orders. It has to work also in offline mode. Usually 10 - 15 orders are taken each day, they are put into a Workbox queue and when there is finally internet at the end of the day, the requests are all resent. The…

JohnnyK
- 33
- 1
- 5
0
votes
0 answers
Alternatives to the Periodic Background Sync API
I have a PWA that fetches server data from within the service worker, remembering that the app is installed and running in the background.
I currently use the Periodic Background Sync API, but it doesn't work correctly.
Does anyone know of an…

Lucas
- 394
- 2
- 13
0
votes
1 answer
Django PWA - Periodic Background Sync
I have a django application (not yet PWA) in which I got asked to implement a feature that makes the app upload the users location to an API. This is because the app is used for truck operators. The client wants to be able to follow where the truck…

Arthur de groote
- 3
- 1
0
votes
0 answers
How to get an image from queued request body (Workbox PWA)
I am using Workbox in my PWA. If app is offline and image posting request fails - it is automatically added to IndexedDB.
const post = (file: File) => {
const formData = new FormData()
formData.append("image", file);
…

Mitriy
- 1
- 2
0
votes
1 answer
How to perform background synchronizations in uwp (like android)
I have an app where large chunk of data need to be synchronized whenever push message comes.
When app is running its working ok.
But if app is not running, then when push comes,
synchronization appservice is terminated by platform after short time…

deba
- 87
- 5
0
votes
1 answer
Service worker: background synchronization event doesn't fire on network restore [Chrome]
I have the following minor application:
(angular 13 - main thread)
home.component.ts
public sendIssueDescription(e) : void {
e.preventDefault();
if('serviceWorker' in navigator && 'SyncManager' in window) {
…

Serdg D.
- 65
- 3
0
votes
1 answer
Promise in background sync
I have a promise which return an array of objects from IndexedDB:
const syncData = () => {
return new Promise((resolve, reject)=>{
var all_form_obj = [];
var db = self.indexedDB.open('Test');
db.onsuccess = function(event) {
…

sam
- 95
- 1
- 2
- 10