Skip to content

Instantly share code, notes, and snippets.

@marmay
marmay / gist:13854bba177d853545a038145bdc84e4
Last active January 24, 2026 18:00
miso-bug-report-2
commit 696f38022202ccdca597b439988144560538032c
Author: Markus Mayr <markus.mayr@outlook.com>
Date: Sat Jan 24 18:17:18 2026 +0100
Fix component lifecycle bugs causing leaks and event issues
Four fixes for component lifecycle management:
1. Copy componentId when VComp keys match (dom.ts)
When diffing two VComps with matching keys, the componentId was not

Bug Report: VComp Child Parent Reference Not Updated During Diff

Summary

When a parent component and its child component both re-render (e.g., both have subscriptions that fire simultaneously), event delegation permanently breaks. Events stop firing because the VTree's VComp.child reference points to a stale child VTree that doesn't match the actual DOM.

Reproduction Scenario

  1. Create a parent component with a subscription (e.g., M.subs = [someSubscription])
  2. Nest a child component that also has its own subscription