Skip to content

useErrorBoundary and retry=false: reset doesn't work if an error was caused by being Offline #2222

@Shaddix

Description

@Shaddix

Describe the bug
Resetting error boundary doesn't re-fetch the query if an error was caused by being Offline (and retry=false). The fallback UI is still displayed after user is already Online and Reset button is pressed.

This is probably somewhat related to #2179.

To Reproduce

  1. Go to https://stmgh.csb.app/
  2. Open Chrome Dev Tools, disable cache, set Throttle to Offline (or disable All Network Adapters on your PC. Disabling cache is needed anyway)
  3. Click on refetch
  4. Fallback UI is displayed
  5. Set Throttle to 'No Throttle' in Dev. tools.
  6. Press Reset.
  7. Fallback UI is still displayed, according to Dev Tools no API request is being actually sent.

Expected behavior
Fallback UI should immediately disappear, API request should be sent, 'loading...' should be shown, which should change to displaying actual data once the API call succeeds.

Or as discussed in #2179 maybe the query shouldn't switch to error or fetching state at all, if the user is currently offline.

This is probably just another scenario to consider when deciding about #2179.

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