solid-playground icon indicating copy to clipboard operation
solid-playground copied to clipboard

Playground - Counter example: change version to make counter increment 2 times instead of 1

Open paritosh149 opened this issue 4 years ago • 3 comments

Title: Double increment upon version change Note: Possible bug in playground (not sure)

Steps:

  1. On Solid JS - Playground, goto counter Example,
  2. as soon as the HTML button is visible, change the version of Solid JS,
  3. Click the Counter Button to observe double increments (increment by 2)

Expected: After changing the version of SolidJS on Playground, the button should increment by 1

paritosh149 avatar Jun 29 '21 10:06 paritosh149

Confirmed as a bug. I can reproduce.

I'm going to move this one to the appropriate repo.

ryansolid avatar Jun 29 '21 16:06 ryansolid

This is such a weird behavior. There must be some sort of cleanup that's not being properly done on the events handlers when switching versions. I'll investigate. Thanks for bringing that up to my attention.

amoutonbrady avatar Jul 04 '21 19:07 amoutonbrady

Implementing the code for the reload button I think I found the place where this is failing, but I've yet to figure out why. Probably a race condition in the way the iframe handle code updates and deregister the previous mounted app, somewhere in there: https://github.com/solidjs/solid-playground/blob/master/src/components/preview.tsx#L152-L181

amoutonbrady avatar Jul 30 '21 20:07 amoutonbrady