Skip to content

[2.1] Fixes #37771: clear React Aria controlled props with null, and lint for it - #37781

Merged
chirag-madlani merged 1 commit into
2.1from
backport/2.1/pr-37772
Nov 13, 2026
Merged

chirag-madlani merged 1 commit into
2.1from
backport/2.1/pr-37772

Conversation

@chirag-madlani

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #37771

Backport of #37772 to 2.1. A clean cherry-pick of 8a03f70.

The automated backport for #37772 targeted only 2.0 (the release endpoint lists ["2.0"]), so this raises the 2.1 one by hand.

Clearing an async query builder select value in one go (Cmd+Delete, or select-all + Delete) crashed the page with "Maximum update depth exceeded". OMSelectWidget fell back to selectedKey={undefined} for an empty value, which React Aria reads as uncontrolled; its own selection then fought the query builder's until React gave up. The PR passes null there and in the four other places that had the same fallback (OMFieldSelect, CoreRadioWidget, ServiceAttributesCard, the service Agents sub-tabs). It adds the ESLint rule openmetadata-ui-patterns/no-undefined-controlled-prop (error) and ADR:2026-11-13-react-aria-controlled-props-are-cleared-with-null-not-undefined.

Type of change:

  • Bug fix

Tests:

Run on 2.1 at 10e33cc07af (this branch's base) with the commits applied:

  • New rule over openmetadata-ui and openmetadata-ui-core-components sources on 2.1: 0 findings in 2,988 files, so enabling it at error does not fail this branch's lint.
  • eslint-rules/openmetadata-ui-patterns.test.mjs: 58/58 pass.
  • Jest utils/queryBuilderWidgets, Settings/Services/ServiceAttributes, common/FormBuilderV1: 145/145 pass, including OMSelectWidget › keeps the async select controlled when its value is cleared.

Browser verification (before/after of the crash, the field select, the Agents sub-tabs) is in #37772.

Checklist:

🤖 Generated with Claude Code

…or it (#37772)

* Fixes #37771: keep the async query builder select controlled when cleared

OMSelectWidget passed selectedKey={undefined} to Select.ComboBox for an
empty value, which hands the selection to React Aria. Clearing the input
then looped between its state and the query builder's until React threw
"Maximum update depth exceeded". Pass null, as the sync Select already does.

* Fixes #37771: clear React Aria controlled props with null, and lint for it

The same undefined fallback that crashed the async select also sat on the
query builder field select, the form radio widget, the service environment
select and the service agents sub-tabs. Each now passes its empty controlled
value. A new ESLint rule, openmetadata-ui-patterns/no-undefined-controlled-prop,
fails a literal undefined fallback on a controlled prop, and the decision
record states the rule for the cases the lint cannot see.

* Format the no-undefined-controlled-prop rule and its tests

(cherry picked from commit 8a03f70)
@chirag-madlani
chirag-madlani requested a review from a team as a code owner November 13, 2026 14:19
@chirag-madlani
chirag-madlani requested review from ShaileshParmar11 and removed request for a team November 13, 2026 14:19
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@chirag-madlani chirag-madlani added the safe to test Add this label to run secure Github workflows on PRs label Nov 13, 2026
@gitar-bot

gitar-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Changing React Aria controlled-value fallbacks to null across UI components could affect selection and reset behavior where wrappers expect undefined.

Backports the fix for clearing async query builder selects, which previously crashed with "Maximum update depth exceeded". Empty values now pass null instead of undefined to React Aria controlled props in OMSelectWidget, OMFieldSelect, CoreRadioWidget, ServiceAttributesCard, and the service Agents sub-tabs, and adds the openmetadata-ui-patterns/no-undefined-controlled-prop lint rule. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@chirag-madlani
chirag-madlani merged commit c1662da into 2.1 Nov 13, 2026
53 of 54 checks passed
@chirag-madlani
chirag-madlani deleted the backport/2.1/pr-37772 branch November 13, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant