Frontmatter
| id | 9305 |
| title | Fix: StateProvider `createBinding` overwrites multi-bindings and leaks effects |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Feb 25, 2026, 7:52 PM |
| updatedAt | Feb 25, 2026, 8:20 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9305 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Feb 25, 2026, 7:58 PM |
Fix: StateProvider createBinding overwrites multi-bindings and leaks effects

tobiu
Feb 25, 2026, 7:53 PM
Input from Gemini 3.1 Pro:
✦ I have successfully updated
src/state/Provider.mjsto use a unique${componentId}-${configKey}map key increateBinding.Additionally, if a dynamically assigned binding overwrites an existing key, the old
Effectis now safelydestroy()ed before the new one is created.I have committed and pushed the changes to the
devbranch. Marking this issue as resolved!
tobiu closed this issue on Feb 25, 2026, 7:58 PM
tobiu assigned to @tobiu on Feb 25, 2026, 8:20 PM
When a component has multiple bindings (e.g.
bind: {text: ..., disabled: ...}),Neo.state.Provider.createBinding()used thecomponentIdas the key for its internal#bindingEffectsmap. This caused subsequent bindings to overwrite previous ones in the map, losing track of them for cleanup.Additionally, if a developer dynamically re-assigned a binding to the same config key, the old
Neo.core.Effectwas never destroyed, leading to memory leaks and conflicting reactivity updates.This fix:
#bindingEffectsmap key to be unique per config:${componentId}-${configKey}.mapKey, the oldEffectis properlydestroy()ed before the new one is created.