Skip to content

🐛BackgroundSyncPlugin doesn't sync when connection is back #3335

Open
@AntoLC

Description

@AntoLC

Library Affected:
workbox-background-sync

Browser & Platform:
Chrome Version 125.0.6422.142 (Official Build) (64-bit)

Issue or Feature Request Description:
It just doesn't sync when the connection is back. When I reload my page, the event sync doesn't seem listened anymore. After a while the sync is triggered but quite some time after we have the connection back (3 or 4mn maybe).

The implementation is quite basic:

registerRoute(
    ({ url }) => isApiUrl(url.href) && url.href.match(/.*\/documents\/.*\//),
    new NetworkOnly({
      plugins: [
        new ApiPlugin({ type: 'update' }), // to update the cache with new data
        new BackgroundSyncPlugin('queue-doc-api'), // save when connection is back
      ],
    }),
    'PATCH',
  );

Demo

scrnli_6_17_2024_12-47-05.PM.webm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions