Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The backround sync does not work immediately #10

Closed
realconvis opened this issue Dec 23, 2022 · 1 comment
Closed

The backround sync does not work immediately #10

realconvis opened this issue Dec 23, 2022 · 1 comment

Comments

@realconvis
Copy link

I try to get the backround sync running for a PWA with this config:

workbox: {
        runtimeCaching: [
          {
            handler: "NetworkOnly",
            urlPattern: new RegExp("^https://localhost/api/basic_packages$"),
            method: "POST",
            options: {
              backgroundSync: {
                name: "postQueue",
                options: {
                  maxRetentionTime: 24 * 60,
                },
              },
            },
          },

I clear all local storages and caches and load the application in browser.
I install the application.
I select the checkbox "offline" for serviceworker in devtools of chrome.
The post requests do not end up in the queue.
But if i reload the PWA while offline, it suddenly works.
The matching requests end up in the queue like expceted.

If i use a string instead of the regexp, it works from the beginning without the reload.

What could be the problem?

@realconvis
Copy link
Author

sorry, wrong category - i´ll post it in the right category

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant