Skip to content

Comments

fix: prevent subscription accumulation#320

Open
SamuelCox wants to merge 1 commit intobenfl3713:masterfrom
SamuelCox:fix-empty-departure-board
Open

fix: prevent subscription accumulation#320
SamuelCox wants to merge 1 commit intobenfl3713:masterfrom
SamuelCox:fix-empty-departure-board

Conversation

@SamuelCox
Copy link

Hopefully fixes #300

It's been years since I've worked in angular/rxJS so take all of this with a grain of salt, so I kind of went with my gut feel and still need to test when I find some time. But, loosely:
We push to subscriptions inside of some nested subcription.subscribe calls. I think that will over time accumulate more and more subscriptions, and eventually out of memory or something like that. That would be consistent with the behaviour I've seen.

The combination of switchMap and combineLatest should fix this, but I'll leave this as a draft PR until I've tested

@netlify
Copy link

netlify bot commented Jan 5, 2026

Deploy Preview for leddepartureboardcom ready!

Name Link
🔨 Latest commit 51214d9
🔍 Latest deploy log https://app.netlify.com/projects/leddepartureboardcom/deploys/695c2fa8681ca50008636e55
😎 Deploy Preview https://deploy-preview-320--leddepartureboardcom.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ben-fletcher ben-fletcher marked this pull request as ready for review January 7, 2026 09:33
Copy link
Collaborator

@ben-fletcher ben-fletcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Looks good to me ✅
Would of taken me quite a while to track this down.

@benfl3713
Copy link
Owner

I think you may have some issues with merging due to a bug in my GitHub actions. Let me know when you're happy to merge though and I can override it for you

@SamuelCox
Copy link
Author

Cheers, will do. It definitely seems better than it was but I think there might be another subscription leak or similar issue somewhere that I'm trying to track down.

Also need to test I haven't broken firebase functionality as haven't got around to that yet, will let you know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web page hangs if left running for a few hours

3 participants