sadpandajoe opened a new issue, #44915:
URL: https://github.com/apache/superset/issues/44915

   
   ### Bug description
   
   When the datasource control changes, `ExploreViewContainer` calls the 
imported thunk creator `fetchDatasourceMetadata(...)` directly. That only 
builds a thunk function and discards it; nothing is dispatched, so no metadata 
refresh happens from this code path. The inline comment (`this should really be 
handled by actions`) suggests it was meant to run.
   
   Impact depends on other code paths that already update the datasource in the 
store; related symptom reports about stale datasource metadata after swapping a 
dataset in Explore may involve this, but I have not confirmed that link.
   
   ### Where
   
   `superset-frontend/src/explore/components/ExploreViewContainer/index.tsx`
   - L81 `import { fetchDatasourceMetadata } from 
'src/dashboard/actions/datasources';`
   - L702-L709: `fetchDatasourceMetadata(props.form_data.datasource);` (result 
discarded)
   - `mapDispatchToProps` (L1429-L1441) binds `datasourcesActions`, not this 
thunk.
   
   The thunk itself (`src/dashboard/actions/datasources.ts` L55-L68) only does 
work when dispatched.
   
   ### Suggested fix
   
   Dispatch it: add the thunk to the bound `actions` (or use `useDispatch`) and 
call `props.actions.fetchDatasourceMetadata(...)`; or delete the dead call if 
another path already covers it.
   
   ### Found by
   
   Found while adding React Testing Library coverage for Explore controls (all 
line numbers are against `master` at `bc3698b5d6`).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to