Skip to content

Outage detail page polls even after component unmount #264

Description

@usmanimamu17-create

The outage detail page (src/app/outages/[id]/page.tsx) implements a 15-second polling interval to fetch updates while the outage status is "open". The cleanup function only calls controller.abort() and clearInterval(). If the user navigates away before the interval fires, the in-flight getOutage request may resolve after unmount, attempting to call setOutage(data) on an unmounted component.

Root cause: Lines 118-134 in src/app/outages/[id]/page.tsx - setOutage called after unmount if navigation occurs mid-request.

Why this is architecturally hard

  1. AbortController aborts the request but promise may still resolve
  2. The mountedRef pattern used in SessionProvider is not applied here
  3. React 19 concurrent features may re-render after effects cleaned up

Acceptance criteria

  • Navigating away while poll request in-flight does not trigger state update on unmounted component
  • No React warnings about state updates on unmounted components
  • Test verifies cleanup

Getting started

Files: src/app/outages/[id]/page.tsx

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions