aminghadersohi opened a new pull request, #42581:
URL: https://github.com/apache/superset/pull/42581
### SUMMARY
The dataset-creation metadata preview now preserves structured API errors
and renders them through the registered error-message system, so OAuth2
authorization failures display the existing authorization prompt instead of a
generic empty error state.
After a matching OAuth2 completion notification, the preview retries only
its original table-metadata request. This keeps the existing raw
`SupersetClient` call rather than migrating a single request to RTK Query,
avoiding a larger change and broad cache invalidation of unrelated metadata
requests. The shared OAuth2 component now accepts the existing optional
mitigation callback and deduplicates the BroadcastChannel and storage
notifications emitted for the same tab.
The blast radius is limited to dataset creation and the optional callback
path in the shared OAuth2 message; SQL Lab, Explore, dashboard, and default
CRUD retry behavior are unchanged when no callback is supplied. Request IDs
prevent stale or unmounted requests from updating the preview. Rollback is a
revert of this commit.
Review guidance: start with `DatasetPanel/index.tsx` for error parsing and
scoped retry, then follow `errorMitigationFunction` through
`ErrorMessageWithStackTrace` into `OAuth2RedirectMessage`.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not included because a local Superset backend was unavailable. The UI uses
the existing OAuth2 authorization alert, and React Testing Library coverage
verifies the authorization link and successful automatic retry.
### TESTING INSTRUCTIONS
1. Configure a database that uses OAuth2 authentication.
2. In the dataset-creation flow, select a table whose metadata request
requires authorization.
3. Verify the authorization alert and link are displayed.
4. Complete authorization in the opened tab and verify the selected table's
columns load automatically without reselecting the table.
Automated validation:
```bash
cd superset-frontend
npm run test -- \
src/components/ErrorMessage/ErrorMessageWithStackTrace.test.tsx \
src/components/ErrorMessage/OAuth2RedirectMessage.test.tsx \
src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.test.tsx \
src/features/datasets/AddDataset/DatasetPanel/DatasetPanelWrapper.test.tsx
\
src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.subdirectory.test.tsx
\
src/features/datasets/DatasetLayout/DatasetLayout.test.tsx
```
All 6 suites and 37 tests pass. Scoped Prettier, Oxlint, custom frontend
rules, and stylelint checks pass. The targeted type-check hook could not
complete locally because the clean worktree lacks built workspace declaration
outputs (TS6305); CI builds those package outputs.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
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]