sparcopt / bifrost-hub

Web App to administer Valheim dedicated servers and monitor all of your viking activities.
MIT License
5 stars 1 forks source link

Subscription leak on page load #20

Closed sparcopt closed 10 months ago

sparcopt commented 10 months ago

Issue

When the dashboard page is opened it subscribes to game events. For every new page load, new subscriptions are made. Since the old subscriptions are not disposed, subscriptions continue to grow and the logic contained in them is executed multiple times.

This PR adds a transient GameActivityConsumer that manages the active subscriptions per page and disposes them when the page is closed. It also abstracts some of the async logic required for async subscriptions.

Closes #18