Files
superset2/superset-frontend/src
Evan Rusackas ae13b10ce3 fix(DatasourceEditor): break infinite re-render loop in function component conversion
The class-to-function conversion of DatasourceEditor introduced an infinite
re-render loop that prevented the edit dataset modal from becoming interactive,
causing 30s timeouts in Playwright tests.

Root cause: Multiple useEffect hooks fired on mount and triggered
validateAndChange() -> parent onChange() -> parent re-renders with new
propsDatasource reference -> useEffect fires again -> infinite loop.

Fixes:
- Add isInitialMount ref to skip validation effects on first render
  (matching original componentDidMount which never called validateAndChange)
- Remove setTimeout(callback, 0) from onDatasourceChange (redundant with
  the useEffect that already watches datasource changes)
- Add prevPropsDatasourceRef to prevent useEffect([propsDatasource]) from
  re-processing unchanged prop references
- Add isSyncingColumnsFromProps ref to distinguish prop-sync column updates
  (which should NOT trigger validation) from user-initiated column changes
  (matching original class behavior where componentDidUpdate called setState
  without a validation callback)

Also restores missing props in CollectionTable function component:
- filterTerm/filterFields: Client-side collection filtering
- pagination: Controlled pagination config passthrough

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 15:39:59 -08:00
..