luwes / luwes/sinuous

Cleanups inside sample are not called, leaking

Open
#196 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
JavaScript
Stars
1.1k
Forks
34
PR merge metrics
No merged PRs in 30d

Description

In the following Solid code you can see in the console a message gets printed about once every second: https://playground.solidjs.com/?hash=-357212261&version=1.3.7

I don't have the equivalent code for Sinuous, but I'm pretty sure that it won't work right in Sinuous, because by calling `sample` the tracking object is removed, so cleanups are not registered with anything, so they never get called, so you'll see in Sinuous that there will be 4 intervals running at the same time, because they won't be stopped, while there should be just one, like in Solid.

The solution seems to be that in Solid the tracking object and the tracking object for cleanups aren't necessarily the same object, so while there isn't a regular tracking object inside `sample` cleanups kind of bubble up until they can find a parent computation that they can attach themselves to.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the cleanup leak using the linked Solid playground example, then inspect Sinuous's sample implementation and cleanup registration behavior. Confirm that repeated execution leaves multiple intervals active; done means cleanup callbacks are attached to an enclosing computation and only one interval remains active.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.