Skip to content

InvoiceListSentinel does not disconnect IntersectionObserver on unmount #588

Description

@Kingsman-99

Description

InvoiceListSentinel creates an IntersectionObserver to trigger infinite-scroll loading but does not call observer.disconnect() when the component unmounts. This causes stale callbacks to fire after navigation, which can trigger redundant API calls.

Acceptance Criteria

  • The IntersectionObserver is disconnected inside a useEffect cleanup function
  • No stale callbacks fire after the component unmounts
  • Infinite scroll continues to work correctly during normal use
  • Existing tests continue to pass

Context

  • Target file: src/components/InvoiceListSentinel.tsx

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions