unabridged / motion

Reactive frontend UI components for Rails in pure Ruby
https://github.com/unabridged/motion
MIT License
697 stars 19 forks source link

Never unsubscribe before receiving connected #58

Closed alecdotninja closed 4 years ago

alecdotninja commented 4 years ago

I think a race here explains the intermittent test failures that recently became more prominent.

I suspect it also fixes the memory leak observed by @dannyvanhoof in #49 . My theory is that if unsubscribe is called too soon, the subscription is still created after the component is unmounted and left dangling in memory. I have not done thorough testing of this though.