You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Refactor] EventSource in Load Test Page to Singleton Pattern #101
Refactor Load Test page to use a singleton pattern for EventSource.
Prevent multiple EventSource instances from being created during re-renders or tab switches.
Add proper lifecycle handling (e.g., connect once, close on unmount).
Describe Solution
Currently, the Load Test page creates a new EventSource instance each time the component is mounted or re-rendered, which may cause duplicate event listeners or memory leaks.
To resolve this, we should refactor the EventSource connection logic to follow the singleton pattern. This ensures that only one connection exists across the application lifecycle unless explicitly reset.
The singleton instance can be created in a utility module and shared across consumers. It should also handle reconnections or clean-up when needed.
Additional Info
Related to performance and network efficiency on long-running load tests.
Activity