Skip to content

Infinite loop on Stats bar #883

@jonkiky

Description

@jonkiky

We found an issue, when query data for stats bar fails, it will fall into Infinite loop to retry fetching data from backend.

In the AllStateController.js, when state,stats.isFetched is true , it will stop dispatch to make another API call.

AllStateController.js

const Stats = () => { const data = useSelector((state) => { if (!state.stats.isFetched) { const dispatch = useDispatch(); dispatch(fetchDataForStats()); } return state.stats.data; });

In redux state, when query data fails, isFetched property is false, it will result in dispatching fetchDataForStats event, until query get data successfully. When backend is not back, it will make infinite call to the backend.

StatsState.js
case STATS_QUERY_ERR: return { ...state, hasError: true, error: action.error, isLoading: false, isFetched: false, };

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