Skip to content

PoolDetail auto-refresh interval lacks unmount guard triggers setState warnings #960

Description

@dimka90

The PoolDetail component in web/app/pools/[id]/page.tsx sets up a 10-second auto-refresh interval (lines 120-130) that calls fetchPool() and fetchUserBet(). Neither callback has a mounted-guard check:

  • fetchPool (lines 55-64) unconditionally calls setPool() and setError() after await
  • fetchUserBet (lines 66-77) calls setUserBet() after await

If the component unmounts while a refresh is in-flight, React logs a Can't perform a React state update on an unmounted component warning. Other hooks (useUserActivity, usePoolActivity) correctly implement mountedRef checks, but PoolDetail does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions