fix(Designer): Add null safety to localeCompare in connector sort#8949
fix(Designer): Add null safety to localeCompare in connector sort#8949
Conversation
The defaultSortConnectors comparator in browseView.tsx was not handling connectors with undefined displayName, causing a TypeError when Array.sort called localeCompare on undefined. This adds nullish coalescing to both sides of the comparison, matching the pattern already used in designer-v2's connectorBrowse.tsx.
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
❌ Impact of Change
❌ Test Plan
✅ Contributors
✅ Screenshots/Videos
Summary Table
Summary This PR is small, safe, and appropriate to be labeled risk:low. The title and high-level body are good. The main inconsistency is the Test Plan: unit tests were added but the box was not checked. Please update the PR body to reflect the added unit tests and optionally expand the Impact section to mention the tests and how to run them. Once you update the Test Plan checkbox and the small Impact note, this PR should be ready to merge. Suggested concrete edits to your PR body:
Thank you — please update the Test Plan and Impact sections and re-submit. If you'd like, I can re-check after you update the PR body.Last updated: Fri, 20 Mar 2026 19:40:39 GMT |
There was a problem hiding this comment.
Pull request overview
Fixes a crash in the classic Designer connector browse panel by making the connector sort comparator resilient to missing displayName values (aligning behavior with existing patterns elsewhere in the repo).
Changes:
- Updated the connector sort comparator to coalesce
displayNamevalues to empty strings before callinglocaleCompare.
📊 Coverage Check🎉 All changed files have adequate test coverage! |
Commit Type
Risk Level
What & Why
The defaultSortConnectors comparator in browseView.tsx was not handling connectors with undefined displayName, causing a TypeError when Array.sort called localeCompare on undefined. This adds nullish coalescing to both sides of the comparison, matching the pattern already used in designer-v2's connectorBrowse.tsx.
Impact of Change
Test Plan
Confirmed connector sort is working without crashing
Contributors
@rllyy97
Screenshots/Videos
N/A