Skip to content

Fix component listeners for prototype-named IDs - #8349

Open
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/fix-component-event-listener-ids
Open

Fix component listeners for prototype-named IDs#8349
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/fix-component-event-listener-ids

Conversation

@OskarEichler

Copy link
Copy Markdown

Problem

ComponentEventsObserver stores public component IDs in a normal object and removes them through Lodash path semantics. IDs such as toString and __proto__ therefore collide with inherited properties, while IDs containing dots are interpreted as nested paths. Their listeners can attach incorrectly and remain active after unmounted().

Fix

  • use a prototype-free registry for component IDs
  • delete component and subscription keys directly, preserving every ID literally
  • remove the no-longer-needed lodash/unset import

Breaking changes

None. Ordinary component IDs retain the same behavior; previously broken valid string IDs now register and clean up correctly.

Test plan

  • Added parameterized regressions for dotted, toString, and __proto__ component IDs.
  • Exact baseline fails the prototype-name cases; the fixed focused suite passes 16/16 tests.
  • Full yarn test-js passes: 38 suites/398 tests; 11 suites/59 tests remain intentionally skipped.
  • Focused ESLint, Bob module/type builds, and git diff --check pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant