Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understand why zombie subscriptions are running #147

Open
danielcompton opened this issue Feb 9, 2018 · 3 comments
Open

Understand why zombie subscriptions are running #147

danielcompton opened this issue Feb 9, 2018 · 3 comments
Labels
bug? Unsure if this is a bug in re-frame-10x needs info Waiting for reporter to provide more information size:medium

Comments

@danielcompton
Copy link
Contributor

While developing re-frame-trace we've seen subscriptions that have been disposed are then re-run later. We need to work out whether this is due to:

  • A bug in user code
  • A bug in re-frame
  • A bug in reagent
  • Elsewhere?

c.f. reagent-project/reagent#270.

@danielcompton danielcompton added this to the 0.2.0 milestone Feb 9, 2018
@mike-thompson-day8
Copy link
Contributor

mike-thompson-day8 commented Feb 10, 2018

Didn't we establish that this is related to a figwheel reload?

Speculation: on a figwheel re-compile/reload, we dispose all existing subscriptions, and clear the subscription cache. We speculate that Zombies arise when one of these "gotten-rid-of' subscriptions comes back to life.

@danielcompton
Copy link
Contributor Author

Figwheel reloading is the trigger, but it's still not clear what the mechanism is for resurrecting the disposed subscriptions. Your speculation seems correct to me, the question we need to answer is why do they come back, and how?

@danielcompton
Copy link
Contributor Author

danielcompton commented Feb 12, 2018

Looking more at this it seems like it is only triggered by Figwheel reloads of changes to re-frame-trace. This only happens when you are developing re-frame-trace alongside your main application. It doesn't appear to happen when your main application has a figwheel reload.

The cause of the zombie resurrection we've observed is an on-click handler dereferencing a subscription (and possibly not dereferencing the subscription within the view fn). What's not clear is how that on-click handler persists through the Figwheel reloads, as the on-jsload function is running which seems like it should trigger a re-render.

It would still be good to get to the bottom of this, but it's no longer a blocker for release.

@danielcompton danielcompton removed this from the 0.2.0 milestone Feb 12, 2018
@danielcompton danielcompton added needs info Waiting for reporter to provide more information bug? Unsure if this is a bug in re-frame-10x labels Apr 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? Unsure if this is a bug in re-frame-10x needs info Waiting for reporter to provide more information size:medium
Projects
None yet
Development

No branches or pull requests

3 participants