mirror of
https://github.com/apache/superset.git
synced 2026-06-01 13:49:21 +00:00
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>