rusackas commented on code in PR #41285:
URL: https://github.com/apache/superset/pull/41285#discussion_r3475072136
##########
superset-frontend/src/core/sqlLab/sqlLab.test.ts:
##########
@@ -561,10 +561,28 @@ test('createTab dispatches ADD_QUERY_EDITOR and returns
the new tab', async () =
expect(tab).toBeDefined();
expect(tab.title).toBe('Custom Tab');
+ // A freshly created tab has no backend identifier until it syncs.
+ expect(tab.backendId).toBeUndefined();
const tabs = sqlLab.getTabs();
expect(tabs.length).toBeGreaterThanOrEqual(2);
});
+test('getTabs leaves backendId undefined when the editor has no tabViewId', ()
=> {
+ // The preloaded editor has no tabViewId, so its backendId stays undefined.
+ const [tab] = sqlLab.getTabs();
+ expect(tab.id).toBe(EDITOR_ID);
+ expect(tab.backendId).toBeUndefined();
+});
+
+test('getTabs surfaces the editor tabViewId as the tab backendId', () => {
+ // Stamp a backend id onto the editor and confirm it flows through to the
tab.
+ (mockStore.getState().sqlLab.queryEditors[0] as any).tabViewId =
'backend-42';
Review Comment:
Fixed — cast to `QueryEditor` (it already carries optional `tabViewId`)
instead of `any`.
##########
superset-frontend/src/extensions/ExtensionsStartup.tsx:
##########
@@ -67,9 +70,28 @@ const ExtensionsStartup: React.FC<{ children?:
React.ReactNode }> = ({
views,
};
+ // Load extensions without blocking the initial render (see #40915);
+ // surface any load failure as a warning toast instead of failing silently.
if (isFeatureEnabled(FeatureFlag.EnableExtensions)) {
- ExtensionsLoader.getInstance().initializeExtensions();
+ ExtensionsLoader.getInstance()
+ .initializeExtensions()
+ .then(() =>
+ supersetCore.utils.logging.info(
+ 'Extensions initialized successfully.',
+ ),
+ )
+ .catch(error => {
Review Comment:
Fixed — typed the rejection param as `unknown`.
##########
superset-frontend/src/extensions/ExtensionsStartup.test.tsx:
##########
@@ -291,6 +289,17 @@ test('continues rendering children even when
ExtensionsLoader initialization fai
).toBeInTheDocument();
});
+ // The failure must reach the user as a warning toast rather than being
+ // swallowed silently.
+ await waitFor(() => {
+ const toasts = (store.getState() as any).messageToasts;
Review Comment:
Fixed — narrowed the `getState()` result to the `messageToasts` shape
instead of `any`.
--
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]