Skip to content

Bug: CoreStateProvider polling race — state update on unmounted component #1934

@Liohtml

Description

@Liohtml

Summary

app/src/providers/CoreStateProvider.tsx — the polling useEffect calls commitState after doRefresh() resolves, even if the component unmounted during the await. The cancelled flag is checked only for rescheduling, not before the state commit.

Impact

Low-Medium — React "update on unmounted component" warnings, potential stale Redux commits from old poll cycles.

Suggested Fix

Check the cancelled ref before calling commitState:

const snapshot = await refreshCore();
if (cancelled) return; // ← add this check
commitState(snapshot);

Or thread an AbortController through the fetch calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions