Skip to content

Fix processor registration and subscription removal - #8346

Open
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/fix-processor-store-removal-and-paths
Open

Fix processor registration and subscription removal#8346
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/fix-processor-store-removal-and-paths

Conversation

@OskarEichler

Copy link
Copy Markdown

Problem

Both processor stores remove subscriptions with splice(index) and no deleteCount. Removing one processor therefore removes it and every processor registered after it. Calling the same subscription twice can also pass -1 and remove the last unrelated processor. Option processor paths additionally use a plain object registry, so valid public paths such as toString and __proto__ collide with inherited properties and fail during registration.

Fix

  • remove exactly one matching processor
  • make each returned subscription independently idempotent, including when the same function is registered twice
  • store option-path arrays in a prototype-free registry
  • retain O(n) lookup and existing processor ordering

Breaking changes

None. The change restores the documented subscription boundary and accepts previously broken string paths.

Test plan

  • Added focused middle-removal regressions for both Layout and Option processor stores.
  • Added duplicate-function regressions proving repeated removal of one subscription cannot remove the second subscription.
  • Added parameterized toString and __proto__ option-path coverage.
  • Focused suites pass: 2 suites, 12 tests.
  • Full yarn test-js passes: 38 suites, 401 tests; 11 suites/59 tests remain intentionally skipped.
  • Focused ESLint, Bob module/type builds, and git diff --check pass.

Existing React act/deprecation warnings are unchanged.

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