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

Add error handling and response expectation options to BackgroundSync #242

Merged
merged 1 commit into from
Oct 5, 2024

Conversation

Spomky
Copy link
Member

@Spomky Spomky commented Oct 5, 2024

Target branch: 1.3.x
Resolves issue #241

  • It is a Bug fix
  • It is a New feature
  • Breaks BC
  • Includes Deprecations

Added configurations for handling 4xx and 5xx errors, expected status codes, and redirect responses in the BackgroundSync functionality. Updated the associated DTO and classes to support these new options, enhancing the robustness and flexibility of background synchronization.

pwa:
    serviceworker:
        enabled: true
        src: "sw.js"
        workbox:
            background_sync:
                - queue_name: 'items'
                  match_callback: 'startsWith: /items/'
                  broadcast_channel: 'items-sync'
                  error_on_4xx: false # When the status code is 4xx, the requests are kept in the queue. Default to false
                  error_on_5xx: true # When the status code is 5xx, the requests are kept in the queue. Default to true
                  expect_redirect: true # When the response is not a redirect, the requests are kept in the queue. Default to false
                  expected_status_codes: [201, 204] #When the status code is not in the list, the requests are kept in the queue. Default to []

@Spomky Spomky added the enhancement New feature or request label Oct 5, 2024
@Spomky Spomky added this to the 1.3.0 milestone Oct 5, 2024
@Spomky Spomky self-assigned this Oct 5, 2024
@Spomky Spomky linked an issue Oct 5, 2024 that may be closed by this pull request
Added configurations for handling 4xx and 5xx errors, expected status codes, and redirect responses in the BackgroundSync functionality. Updated the associated DTO and classes to support these new options, enhancing the robustness and flexibility of background synchronization.
@Spomky Spomky force-pushed the features/background-sync-requeue branch from 8c9fa4d to f2cbd3b Compare October 5, 2024 12:56
@Spomky Spomky merged commit 60444f3 into 1.3.x Oct 5, 2024
11 checks passed
@Spomky Spomky deleted the features/background-sync-requeue branch October 5, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Background Sync Status Code Actions
1 participant