Observed behavior
After upgrading @openfeature/react-sdk from 1.2.0 to 1.2.1 (with @openfeature/web-sdk 1.7.3), memory usage grows continuously in a React page with many useBooleanFlagValue hooks and frequent re-renders.
In our app this leads to multi-GB RSS growth and eventual OOM/abort in browser automation runs.
Regression appears to come from commit e79c06a (react-sdk-v1.2.1), where ProviderEvents.Ready listener in attachHandlersAndResolve became unconditional.
Expected Behavior
useBooleanFlagValue should not cause unbounded memory growth or repeated Ready-driven re-evaluations when provider is already READY.
Steady-state re-renders should keep memory roughly stable.
Steps to reproduce
- Create a React app with:
- Render many components (e.g. 200-1000) each calling
useBooleanFlagValue(...).
- Trigger frequent parent re-renders (e.g. timer/state updates or list interactions/navigation loops).
- Record heap/RSS over time.
- Repeat same repro with
@openfeature/[email protected].
Result:
1.2.1: memory grows steadily (can reach OOM in heavy scenarios).
1.2.0: memory remains stable.
Notes:
- The key delta is in
attachHandlersAndResolve:
1.2.0: register Ready handler only if status is NOT_READY.
1.2.1: always register Ready handler.
Observed behavior
After upgrading
@openfeature/react-sdkfrom1.2.0to1.2.1(with@openfeature/web-sdk 1.7.3), memory usage grows continuously in a React page with manyuseBooleanFlagValuehooks and frequent re-renders.In our app this leads to multi-GB RSS growth and eventual OOM/abort in browser automation runs.
Regression appears to come from commit
e79c06a(react-sdk-v1.2.1), whereProviderEvents.Readylistener inattachHandlersAndResolvebecame unconditional.Expected Behavior
useBooleanFlagValueshould not cause unbounded memory growth or repeatedReady-driven re-evaluations when provider is alreadyREADY.Steady-state re-renders should keep memory roughly stable.
Steps to reproduce
@openfeature/[email protected]@openfeature/[email protected]READY.useBooleanFlagValue(...).@openfeature/[email protected].Result:
1.2.1: memory grows steadily (can reach OOM in heavy scenarios).1.2.0: memory remains stable.Notes:
attachHandlersAndResolve:1.2.0: registerReadyhandler only if status isNOT_READY.1.2.1: always registerReadyhandler.