influxdata / influxdata/influxdb

RemoteDataState.Error is rarely handled

Open
#16,127 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug kind/tech-debt
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.