aminghadersohi commented on code in PR #45843:
URL: https://github.com/apache/superset/pull/45843#discussion_r4443090687


##########
superset-frontend/src/features/databases/DatabaseModal/index.tsx:
##########
@@ -1075,7 +1109,10 @@ const DatabaseModal: 
FunctionComponent<DatabaseModalProps> = ({
         db.id as number,
         dbToUpdate as DatabaseObject,
         dbToUpdate.configuration_method === ConfigurationMethod.DynamicForm, 
// onShow toast on SQLA Forms
+        true,
+        shouldApplyResponse,
       );
+      if (!shouldApplyResponse()) return;
       if (result) {
         if (onDatabaseAdd) onDatabaseAdd();

Review Comment:
   I fixed the late-update refresh in 267316db0d07acbb018a3de6aed9ba839122c049. 
The PUT continuation notifies the parent before checking the session 
generation; modal publication, navigation and closure remain gated.
   
   Regression test: `late update response after X leaves the next connection as 
a fresh POST`
   
   Before, the parent callback was called zero times instead of once. After, it 
is called exactly once for the late response, and the next connection still 
uses POST without the old id or a PUT to the old connection. The same test also 
checks one notification for the subsequent live-session create.
   
   Validation: from superset-frontend, `npx jest 
src/features/databases/DatabaseModal/index.test.tsx --runInBand -t 'late 
(create|update) response after X|Back during pending'` gives 4 failures with 
the production file from c3fe8f85cd9d8f822458eb755260e77d7a6dc4e4, and 4 passes 
with this commit. The broader `npx jest src/features/databases/DatabaseModal 
src/pages/DatabaseList src/features/home/RightMenu.test.tsx 
src/views/CRUD/hooks.test.tsx --runInBand` gives 14 suites / 304 tests / 2 
snapshots passed. Scoped lint/type checks and staged-file plus 
branch-changed-file pre-commit passed.
   
   Siblings checked:
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1116 — 
fixed in 267316db0d07acbb018a3de6aed9ba839122c049 (update refresh before the 
modal-state guard).
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1143 — 
fixed in 267316db0d07acbb018a3de6aed9ba839122c049 (create refresh before the 
modal-state guard).
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1017 — 
not affected: save-time validation has not written a connection; its stale 
return must still prevent POST.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1185 — 
not affected: the import-save callback already runs without the 
database-session guard.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1665 — 
not affected: the upload/import callback already runs after its returned id 
without this guard.
   - superset-frontend/src/views/CRUD/hooks.ts:454 — not affected: discarded 
GET error publication has no parent-write notification; its finally resets hook 
loading, not modal isLoading.
   - superset-frontend/src/views/CRUD/hooks.ts:502 — not affected: discarded 
POST error publication has no parent-write notification; successful POST still 
returns its id to onSave.
   - superset-frontend/src/views/CRUD/hooks.ts:557 — not affected: discarded 
PUT error publication has no parent-write notification; the hook's return 
contract is unchanged.
   - superset-frontend/src/pages/DatabaseList/index.tsx:1187 — not affected: 
refreshData is the unchanged parent callback, with no additional session guard.
   - superset-frontend/src/features/home/RightMenu.tsx:372 — not affected: 
setQuery({ databaseAdded: true }) is the unchanged create-only parent callback, 
with no additional session guard.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1375 — 
fixed in 267316db0d07acbb018a3de6aed9ba839122c049 (Back invalidates the request 
and immediately resets modal loading).
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:938 — not 
affected: Close/X hides the modal; reopening reinitializes loading and fetches 
available engines, covered by the retained late-create/update tests.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1565 — 
not affected: visibility/target cleanup is followed by the next visible 
effect's loading initialization and engine fetch; the retained target-switch 
regression passes.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1365 — 
not affected: Back from Finish stays on the same saved connection and does not 
increment the generation; the retained step-3 Back cases pass.
   



##########
superset-frontend/src/features/databases/DatabaseModal/index.tsx:
##########
@@ -1100,7 +1137,9 @@ const DatabaseModal: 
FunctionComponent<DatabaseModalProps> = ({
       const dbId = await createResource(
         dbToUpdate as DatabaseObject,
         dbToUpdate.configuration_method === ConfigurationMethod.DynamicForm, 
// onShow toast on SQLA Forms
+        shouldApplyResponse,
       );
+      if (!shouldApplyResponse()) return;
       if (dbId) {
         setHasConnectedDb(true);
         if (onDatabaseAdd) onDatabaseAdd();

Review Comment:
   I fixed the late-create refresh in 267316db0d07acbb018a3de6aed9ba839122c049. 
A returned create id notifies the parent before the session check; a late 
response still cannot advance or close a reopened modal.
   
   Regression test: `late create response after X leaves the next connection as 
a fresh POST`
   
   Before, the parent callback was called zero times instead of once. After, 
the late create refreshes exactly once, the reopened picker remains visible, 
and the next connection uses a fresh POST without the old id. The subsequent 
live create adds exactly one more notification.
   
   Validation: from superset-frontend, `npx jest 
src/features/databases/DatabaseModal/index.test.tsx --runInBand -t 'late 
(create|update) response after X|Back during pending'` gives 4 failures with 
the production file from c3fe8f85cd9d8f822458eb755260e77d7a6dc4e4, and 4 passes 
with this commit. The broader `npx jest src/features/databases/DatabaseModal 
src/pages/DatabaseList src/features/home/RightMenu.test.tsx 
src/views/CRUD/hooks.test.tsx --runInBand` gives 14 suites / 304 tests / 2 
snapshots passed. Scoped lint/type checks and staged-file plus 
branch-changed-file pre-commit passed.
   
   Siblings checked:
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1116 — 
fixed in 267316db0d07acbb018a3de6aed9ba839122c049 (update refresh before the 
modal-state guard).
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1143 — 
fixed in 267316db0d07acbb018a3de6aed9ba839122c049 (create refresh before the 
modal-state guard).
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1017 — 
not affected: save-time validation has not written a connection; its stale 
return must still prevent POST.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1185 — 
not affected: the import-save callback already runs without the 
database-session guard.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1665 — 
not affected: the upload/import callback already runs after its returned id 
without this guard.
   - superset-frontend/src/views/CRUD/hooks.ts:454 — not affected: discarded 
GET error publication has no parent-write notification; its finally resets hook 
loading, not modal isLoading.
   - superset-frontend/src/views/CRUD/hooks.ts:502 — not affected: discarded 
POST error publication has no parent-write notification; successful POST still 
returns its id to onSave.
   - superset-frontend/src/views/CRUD/hooks.ts:557 — not affected: discarded 
PUT error publication has no parent-write notification; the hook's return 
contract is unchanged.
   - superset-frontend/src/pages/DatabaseList/index.tsx:1187 — not affected: 
refreshData is the unchanged parent callback, with no additional session guard.
   - superset-frontend/src/features/home/RightMenu.tsx:372 — not affected: 
setQuery({ databaseAdded: true }) is the unchanged create-only parent callback, 
with no additional session guard.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1375 — 
fixed in 267316db0d07acbb018a3de6aed9ba839122c049 (Back invalidates the request 
and immediately resets modal loading).
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:938 — not 
affected: Close/X hides the modal; reopening reinitializes loading and fetches 
available engines, covered by the retained late-create/update tests.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1565 — 
not affected: visibility/target cleanup is followed by the next visible 
effect's loading initialization and engine fetch; the retained target-switch 
regression passes.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1365 — 
not affected: Back from Finish stays on the same saved connection and does not 
increment the generation; the retained step-3 Back cases pass.
   



##########
superset-frontend/src/features/databases/DatabaseModal/index.test.tsx:
##########
@@ -336,6 +340,385 @@ describe('DatabaseModal', () => {
       useRedux: true,
     });
 
+  /** Check that closing a mounted modal cannot reuse a saved connection id. */
+  const expectFreshCreateAfterEdit = async (
+    closeAction: 'Close' | 'X' | 'Finish' | 'Late X',
+  ): Promise<void> => {
+    const resourceHook = jest.spyOn(hooks, 'useSingleViewResource');
+    const previousImplementation = resourceHook.getMockImplementation()!;
+    resourceHook.mockImplementation(realUseSingleViewResource);
+    let releaseEditFetch: () => void = () => {};
+    const editFetchReady = new Promise<void>(resolve => {
+      releaseEditFetch = resolve;
+    });
+    const editResponse = {
+      result: {
+        id: 10,
+        database_name: 'Existing connection',
+        backend: 'sqlite',
+        configuration_method: ConfigurationMethod.SqlalchemyUri,
+        sqlalchemy_uri: 'sqlite:///existing.db',
+      },
+    };
+    fetchMock.get(
+      'glob:*/api/v1/database/10/connection',
+      closeAction === 'Late X'
+        ? async () => {
+            await editFetchReady;
+            return editResponse;
+          }
+        : editResponse,
+    );
+    fetchMock.put(DATABASE_FETCH_ENDPOINT, {
+      id: 10,
+      result: {
+        database_name: 'Existing connection',
+        backend: 'sqlite',
+        configuration_method: ConfigurationMethod.SqlalchemyUri,
+        sqlalchemy_uri: 'sqlite:///existing.db',
+      },
+    });
+    fetchMock.post('glob:*/api/v1/database/test_connection/', {
+      message: 'OK',
+    });
+    const Harness = () => {
+      const [show, setShow] = useState(true);
+      const [databaseId, setDatabaseId] = useState<number | undefined>(10);
+      return (
+        <>
+          <button type="button" onClick={() => setShow(true)}>
+            + Database
+          </button>
+          <button
+            type="button"
+            onClick={() => {
+              setDatabaseId(10);
+              setShow(true);
+            }}
+          >
+            Edit existing
+          </button>
+          <DatabaseModal
+            show={show}
+            databaseId={databaseId}
+            onHide={() => {
+              setShow(false);
+              setDatabaseId(undefined);
+            }}
+          />
+        </>
+      );
+    };
+    try {
+      render(<Harness />, { useRedux: true });
+      if (closeAction === 'Late X') {
+        await waitFor(() =>
+          expect(
+            
fetchMock.callHistory.calls('glob:*/api/v1/database/10/connection'),
+          ).toHaveLength(1),
+        );
+      } else {
+        expect(
+          await screen.findByDisplayValue('Existing connection'),
+        ).toBeInTheDocument();
+      }
+      await userEvent.click(document.querySelector('.ant-modal-wrap')!);
+      expect(screen.getByRole('dialog')).toBeInTheDocument();
+      if (closeAction === 'Finish') {
+        await userEvent.click(screen.getByRole('button', { name: 'Finish' }));
+      } else if (closeAction === 'X' || closeAction === 'Late X') {
+        await userEvent.click(screen.getAllByLabelText('Close')[0]);
+      } else {
+        await userEvent.click(screen.getByText('Close'));
+      }
+      await waitFor(() =>
+        expect(screen.queryByRole('dialog')).not.toBeInTheDocument(),
+      );
+      if (closeAction !== 'Late X') fetchMock.clearHistory();
+      await userEvent.click(screen.getByRole('button', { name: '+ Database' 
}));
+      await screen.findByRole('dialog');
+      if (closeAction === 'Late X') {
+        await act(async () => {
+          releaseEditFetch();
+          await fetchMock.callHistory.flush(true);
+        });
+      }
+      const picker = screen.queryByRole('heading', {
+        name: /select a database to connect/i,
+      });
+      // Exercise saving even if stale state incorrectly skips the picker.
+      if (picker) {
+        await userEvent.click(
+          await screen.findByRole('button', { name: /sqlite/i }),
+        );
+      }
+      fireEvent.change(await screen.findByTestId('database-name-input'), {
+        target: { value: 'My new sandbox' },
+      });
+      fireEvent.change(screen.getByTestId('sqlalchemy-uri-input'), {
+        target: { value: 'sqlite:///sandbox.db' },
+      });
+      await userEvent.click(
+        screen.getByRole('button', { name: /test connection/i }),
+      );
+      const connect = screen.getByRole('button', { name: 'Connect' });
+      await waitFor(() => expect(connect).toBeEnabled());
+      await userEvent.click(connect);
+      await waitFor(() =>
+        expect(
+          fetchMock.callHistory.calls(DATABASE_CONNECT_ENDPOINT).length +
+            fetchMock.callHistory.calls(DATABASE_FETCH_ENDPOINT, {
+              method: 'PUT',
+            }).length,
+        ).toBeGreaterThan(0),
+      );
+      expect(
+        fetchMock.callHistory.calls(DATABASE_FETCH_ENDPOINT, {
+          method: 'PUT',
+        }),
+      ).toHaveLength(0);
+      expect(picker).not.toBeNull();
+      expect(
+        fetchMock.callHistory.calls(DATABASE_CONNECT_ENDPOINT),
+      ).toHaveLength(1);
+      expect(
+        JSON.parse(
+          fetchMock.callHistory.lastCall(DATABASE_CONNECT_ENDPOINT)!.options
+            .body as string,
+        ),
+      ).not.toHaveProperty('id');
+      await waitFor(() =>
+        expect(screen.queryByRole('dialog')).not.toBeInTheDocument(),
+      );
+      // A successful create also updates the resource cache before closing.
+      await userEvent.click(screen.getByRole('button', { name: '+ Database' 
}));
+      expect(
+        await screen.findByRole('heading', {
+          name: /select a database to connect/i,
+        }),
+      ).toBeInTheDocument();
+      await userEvent.click(screen.getAllByLabelText('Close')[0]);
+      await waitFor(() =>
+        expect(screen.queryByRole('dialog')).not.toBeInTheDocument(),
+      );
+      await userEvent.click(
+        screen.getByRole('button', { name: 'Edit existing' }),
+      );
+      expect(
+        await screen.findByDisplayValue('Existing connection'),
+      ).toBeInTheDocument();
+    } finally {
+      releaseEditFetch();
+      resourceHook.mockImplementation(previousImplementation);
+    }
+  };
+
+  test('closing edit then creating uses POST without the old id', async () => {
+    await expectFreshCreateAfterEdit('Close');
+  });
+
+  test('X edit then creating uses POST without the old id', async () => {
+    await expectFreshCreateAfterEdit('X');
+  });
+
+  test('saving edit then creating uses POST without the old id', async () => {
+    await expectFreshCreateAfterEdit('Finish');
+  });
+
+  test('late edit fetch after X then creating uses POST without the old id', 
async () => {
+    await expectFreshCreateAfterEdit('Late X');
+  });
+
+  /** Check that late writes cannot populate or close a subsequent create 
session. */
+  const expectFreshCreateAfterLateWrite = async (
+    operation: 'create' | 'update',
+  ): Promise<void> => {
+    const resourceHook = jest.spyOn(hooks, 'useSingleViewResource');
+    const previousImplementation = resourceHook.getMockImplementation()!;
+    resourceHook.mockImplementation(realUseSingleViewResource);
+    let releaseWrite: () => void = () => {};
+    const writeReady = new Promise<void>(resolve => {
+      releaseWrite = resolve;
+    });
+    const connection = {
+      id: 77,
+      database_name: 'First connection',
+      backend: 'postgresql',
+      configuration_method: ConfigurationMethod.DynamicForm,
+    };
+    let createCount = 0;
+    fetchMock.modifyRoute('database-connect', {
+      response: async () => {
+        createCount += 1;
+        if (operation === 'create' && createCount === 1) await writeReady;
+        const id = createCount === 1 ? 77 : 88;
+        return { id, result: { ...connection, id } };
+      },
+    });
+    fetchMock.put('glob:*/api/v1/database/77', async () => {
+      await writeReady;
+      return { id: 77, result: connection };
+    });
+    const onDatabaseAdd = jest.fn();
+    const Harness = () => {
+      const [show, setShow] = useState(true);
+      return (
+        <>
+          <button type="button" onClick={() => setShow(true)}>
+            + Database
+          </button>
+          <DatabaseModal
+            show={show}
+            onHide={() => setShow(false)}
+            onDatabaseAdd={onDatabaseAdd}
+          />
+        </>
+      );
+    };
+    /** Fill a new dynamic-form connection without relying on saved state. */
+    const connectPostgres = async (name: string, host: string) => {
+      await userEvent.click(
+        await screen.findByRole('button', { name: /postgresql/i }),
+      );
+      fireEvent.change(
+        document.querySelector<HTMLInputElement>(
+          'input[name="database_name"]',
+        )!,
+        {
+          target: { value: name },
+        },
+      );
+      for (const [field, value] of Object.entries({
+        host,
+        port: '5432',
+        database: 'postgres',
+        username: 'testdb',
+      })) {
+        fireEvent.change(
+          document.querySelector<HTMLInputElement>(`input[name="${field}"]`)!,
+          { target: { value } },
+        );
+      }
+      fireEvent.blur(
+        document.querySelector<HTMLInputElement>('input[name="username"]')!,
+      );
+      const connect = screen.getByRole('button', { name: 'Connect' });
+      await waitFor(() => expect(connect).toBeEnabled());
+      await userEvent.click(connect);
+    };
+    try {
+      render(<Harness />, { useRedux: true });
+      await connectPostgres('First connection', 'first.example');
+      await waitFor(() =>
+        expect(
+          fetchMock.callHistory.calls(DATABASE_CONNECT_ENDPOINT),
+        ).toHaveLength(1),
+      );
+      if (operation === 'update') {
+        expect(await screen.findByText(/step 3 of 3/i)).toBeInTheDocument();
+        await userEvent.click(screen.getByRole('button', { name: 'Finish' }));
+        await waitFor(() =>
+          expect(
+            fetchMock.callHistory.calls('glob:*/api/v1/database/77'),
+          ).toHaveLength(1),
+        );
+      }
+      await userEvent.click(screen.getAllByLabelText('Close')[0]);
+      await waitFor(() =>
+        expect(screen.queryByRole('dialog')).not.toBeInTheDocument(),
+      );
+      await userEvent.click(screen.getByRole('button', { name: '+ Database' 
}));
+      await screen.findByRole('dialog');
+      onDatabaseAdd.mockClear();
+      await act(async () => {
+        releaseWrite();
+        await fetchMock.callHistory.flush(true);
+      });
+      expect(
+        screen.getByRole('heading', {
+          name: /select a database to connect/i,
+        }),
+      ).toBeInTheDocument();
+      expect(onDatabaseAdd).not.toHaveBeenCalled();

Review Comment:
   I corrected the refresh assertion in 
267316db0d07acbb018a3de6aed9ba839122c049: both late-response tests expect 
exactly one parent callback, while retaining the picker, fresh-POST and 
zero-old-PUT assertions. The subsequent live create must add exactly one more 
callback.
   
   Regression test: `late create response after X leaves the next connection as 
a fresh POST`
   Regression test: `late update response after X leaves the next connection as 
a fresh POST`
   
   Each test fails against the original production file at the strengthened 
assertion (expected 1 callback, received 0) and passes with this commit. The 
tests that keep a late response from advancing or closing a later session 
remain in place.
   
   Validation: from superset-frontend, `npx jest 
src/features/databases/DatabaseModal/index.test.tsx --runInBand -t 'late 
(create|update) response after X|Back during pending'` gives 4 failures with 
the production file from c3fe8f85cd9d8f822458eb755260e77d7a6dc4e4, and 4 passes 
with this commit. The broader `npx jest src/features/databases/DatabaseModal 
src/pages/DatabaseList src/features/home/RightMenu.test.tsx 
src/views/CRUD/hooks.test.tsx --runInBand` gives 14 suites / 304 tests / 2 
snapshots passed. Scoped lint/type checks and staged-file plus 
branch-changed-file pre-commit passed.
   
   Siblings checked:
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1116 — 
fixed in 267316db0d07acbb018a3de6aed9ba839122c049 (update refresh before the 
modal-state guard).
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1143 — 
fixed in 267316db0d07acbb018a3de6aed9ba839122c049 (create refresh before the 
modal-state guard).
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1017 — 
not affected: save-time validation has not written a connection; its stale 
return must still prevent POST.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1185 — 
not affected: the import-save callback already runs without the 
database-session guard.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1665 — 
not affected: the upload/import callback already runs after its returned id 
without this guard.
   - superset-frontend/src/views/CRUD/hooks.ts:454 — not affected: discarded 
GET error publication has no parent-write notification; its finally resets hook 
loading, not modal isLoading.
   - superset-frontend/src/views/CRUD/hooks.ts:502 — not affected: discarded 
POST error publication has no parent-write notification; successful POST still 
returns its id to onSave.
   - superset-frontend/src/views/CRUD/hooks.ts:557 — not affected: discarded 
PUT error publication has no parent-write notification; the hook's return 
contract is unchanged.
   - superset-frontend/src/pages/DatabaseList/index.tsx:1187 — not affected: 
refreshData is the unchanged parent callback, with no additional session guard.
   - superset-frontend/src/features/home/RightMenu.tsx:372 — not affected: 
setQuery({ databaseAdded: true }) is the unchanged create-only parent callback, 
with no additional session guard.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1375 — 
fixed in 267316db0d07acbb018a3de6aed9ba839122c049 (Back invalidates the request 
and immediately resets modal loading).
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:938 — not 
affected: Close/X hides the modal; reopening reinitializes loading and fetches 
available engines, covered by the retained late-create/update tests.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1565 — 
not affected: visibility/target cleanup is followed by the next visible 
effect's loading initialization and engine fetch; the retained target-switch 
regression passes.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1365 — 
not affected: Back from Finish stays on the same saved connection and does not 
increment the generation; the retained step-3 Back cases pass.
   



##########
superset-frontend/src/features/databases/DatabaseModal/index.tsx:
##########
@@ -1324,13 +1364,14 @@ const DatabaseModal: 
FunctionComponent<DatabaseModalProps> = ({
 
   const handleBackButtonOnFinish = () => {
     if (dbFetched) {
-      fetchResource(dbFetched.id as number);
+      fetchDatabase(dbFetched.id as number);
     }
     setShowCTAbtns(false);
     setEditNewDb(true);
   };
 
   const handleBackButtonOnConnect = () => {
+    databaseRequestGeneration.current += 1;

Review Comment:
   I fixed the Back/loading path in 267316db0d07acbb018a3de6aed9ba839122c049. 
Back to the picker resets loading at the generation bump instead of relying on 
the abandoned save continuation.
   
   Regression test: `Back during pending create restores the picker and 
discards abandoned modal state`
   Regression test: `Back during pending validation restores the picker and 
discards abandoned modal state`
   
   Both fail against the original production file because PostgreSQL cannot be 
selected after Back: the body remains on Loading with an empty footer. Both 
pass after the change. The dynamic-form validation case is reachable and 
covered: the abandoned validation sends no POST and no parent notification. A 
pending POST may complete and notify once, but cannot move the picker to step 
3. Both cases can then complete a replacement connection.
   
   Validation: from superset-frontend, `npx jest 
src/features/databases/DatabaseModal/index.test.tsx --runInBand -t 'late 
(create|update) response after X|Back during pending'` gives 4 failures with 
the production file from c3fe8f85cd9d8f822458eb755260e77d7a6dc4e4, and 4 passes 
with this commit. The broader `npx jest src/features/databases/DatabaseModal 
src/pages/DatabaseList src/features/home/RightMenu.test.tsx 
src/views/CRUD/hooks.test.tsx --runInBand` gives 14 suites / 304 tests / 2 
snapshots passed. Scoped lint/type checks and staged-file plus 
branch-changed-file pre-commit passed.
   
   Siblings checked:
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1116 — 
fixed in 267316db0d07acbb018a3de6aed9ba839122c049 (update refresh before the 
modal-state guard).
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1143 — 
fixed in 267316db0d07acbb018a3de6aed9ba839122c049 (create refresh before the 
modal-state guard).
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1017 — 
not affected: save-time validation has not written a connection; its stale 
return must still prevent POST.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1185 — 
not affected: the import-save callback already runs without the 
database-session guard.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1665 — 
not affected: the upload/import callback already runs after its returned id 
without this guard.
   - superset-frontend/src/views/CRUD/hooks.ts:454 — not affected: discarded 
GET error publication has no parent-write notification; its finally resets hook 
loading, not modal isLoading.
   - superset-frontend/src/views/CRUD/hooks.ts:502 — not affected: discarded 
POST error publication has no parent-write notification; successful POST still 
returns its id to onSave.
   - superset-frontend/src/views/CRUD/hooks.ts:557 — not affected: discarded 
PUT error publication has no parent-write notification; the hook's return 
contract is unchanged.
   - superset-frontend/src/pages/DatabaseList/index.tsx:1187 — not affected: 
refreshData is the unchanged parent callback, with no additional session guard.
   - superset-frontend/src/features/home/RightMenu.tsx:372 — not affected: 
setQuery({ databaseAdded: true }) is the unchanged create-only parent callback, 
with no additional session guard.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1375 — 
fixed in 267316db0d07acbb018a3de6aed9ba839122c049 (Back invalidates the request 
and immediately resets modal loading).
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:938 — not 
affected: Close/X hides the modal; reopening reinitializes loading and fetches 
available engines, covered by the retained late-create/update tests.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1565 — 
not affected: visibility/target cleanup is followed by the next visible 
effect's loading initialization and engine fetch; the retained target-switch 
regression passes.
   - superset-frontend/src/features/databases/DatabaseModal/index.tsx:1365 — 
not affected: Back from Finish stays on the same saved connection and does not 
increment the generation; the retained step-3 Back cases pass.
   



-- 
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