influxdata / influxdata/influxdb
RemoteDataState.Error is rarely handled
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
In many parts of the app, we handle data fetching status by setting a relevant part of the redux state to RemoteDataState.NotStarted, then RemoteDataState.Loading and RemoteDataState.Done. If the data fetching errors, we set the relevant state to RemoteDataState.Error.
See `src/shared/components/GetResources.tsx` for an example of this.
The problem is that the component we most often pass this RemoteDataState variable to, (the SpinnerContainer) handles only loading and not started states, and renders children directly if the loading state is Error. in effect we treat Done and Error in the same way, and continue to try to render parts of the app which may depend on the resources we have tried to fetch.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/shared/components/GetResources.tsx and trace how its RemoteDataState value reaches SpinnerContainer. Inspect SpinnerContainer's handling of NotStarted, Loading, Done, and Error states. Done means fetching errors no longer render dependent children as though loading succeeded, with the relevant behavior covered by tests if the existing component tests are found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100