Skip to content

Fix editor search indexing of __proto__ node names - #5980

Merged
knolleary merged 3 commits into
node-red:mainfrom
this-caroline:fix/editor-search-proto
Oct 6, 2026
Merged

knolleary merged 3 commits into
node-red:mainfrom
this-caroline:fix/editor-search-proto

Conversation

@this-caroline

@this-caroline this-caroline commented Oct 4, 2026 •

Copy link
Copy Markdown
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

Fixes #5979.

Importing a Comment node named __proto__ leaves the import dialog open and causes JavaScript errors because the search index writes the node entry to Object.prototype.

Initialize and clear the search index with Object.create(null) so __proto__ is treated as an ordinary key. Import now completes, and the node appears in search results.

Add regression tests for node labels and property values, checking that search finds the node and Object.prototype remains unchanged.

Validation

  • Search regression tests: 10 passing.
  • Editor lint and production build: passed.
  • Manually verified import and search in Chrome.
  • npm run test: 2865 passing, 60 pending, 1 failing.

The failure was in watch Node — should watch a sub directory in a directory to be changed, followed by an ENOENT from a delayed test callback.
Rerunning the watch suite in isolation passed all 5 tests.

This appears timing-sensitive and unrelated to the editor search change, but the full suite did not pass.

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • I have run npm run test to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: this-caroline / name: Caroline (8b45cce)

@this-caroline this-caroline changed the title Fix editor search indexing of __proto__ node names #5979 Fix editor search indexing of __proto__ node names Oct 4, 2026

@knolleary knolleary left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this. One small change needed before we can merge.

@knolleary
knolleary merged commit 047b5b4 into node-red:main Oct 6, 2026
3 checks passed
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.

Importing a Comment node named __proto__ breaks the editor

2 participants