Skip to content

Infinite Retries on failed load #1

@leewardbound

Description

@leewardbound

Seems to work great when working against valid URLs with responses; however, currently issuing infinite URL retries when the content is invalid or fails to load.

We tried to prevent this by keeping startTime as a state variable in the hook itself, which when checked with requestOnce helps ensure that only one request is sent; sadly it seems (I'm still learning hook-foo) that startTime isn't getting set properly, or the hook is otherwise dying/aborting and the component is remounting every time.

The first proposed solution is to figure out how to not-reload-the-hook upon fetch() failures; If we can't figure out how to not-reload-the-hook, the next step is probably to create a global const HTTPRequest = React.createContext() and share global state across all the hooks to make sure we're being nice to external services.

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