Skip to content

Conversation

@Varixo
Copy link
Member

@Varixo Varixo commented Jan 21, 2026

Clear back refs for effect subscriber when reusing in computed signal computation

@changeset-bot
Copy link

changeset-bot bot commented Jan 21, 2026

🦋 Changeset detected

Latest commit: df3ed1a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 21, 2026

Open in StackBlitz

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8254
npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8254
npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@8254
npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@8254

commit: df3ed1a

@github-actions
Copy link
Contributor

github-actions bot commented Jan 21, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview df3ed1a

Base automatically changed from v2-fix-iteration-variable-in-qrl-prop to build/v2 January 22, 2026 20:42
@Varixo Varixo marked this pull request as ready for review January 22, 2026 20:42
@Varixo Varixo requested a review from a team as a code owner January 22, 2026 20:42
@Varixo Varixo moved this from Backlog to Waiting For Review in Qwik Development Jan 22, 2026
@Varixo Varixo force-pushed the v2-fix-computed-memory-leak branch from 5c41ee2 to e71937f Compare January 22, 2026 20:51
Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

if (ctx) {
const effectSubscriber = getSubscriber(this, EffectProperty.VNODE);
// clear existing back refs
effectSubscriber.backRef?.clear();
Copy link
Member

@wmertens wmertens Jan 23, 2026

Choose a reason for hiding this comment

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

  • I think the backrefs can be cleared as soon as the signal is marked dirty, because nothing else can make it dirtier
  • But most importantly, when clearing backrefs, each signal must also have this subscriber removed

@Varixo Varixo force-pushed the v2-fix-computed-memory-leak branch from e71937f to df3ed1a Compare January 25, 2026 17:04
Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

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

LGTM

@wmertens wmertens merged commit 77c8051 into build/v2 Jan 26, 2026
20 checks passed
@wmertens wmertens deleted the v2-fix-computed-memory-leak branch January 26, 2026 20:47
@github-project-automation github-project-automation bot moved this from Waiting For Review to Done in Qwik Development Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants