I3eka opened a new pull request, #44498: URL: https://github.com/apache/superset/pull/44498
### SUMMARY Keep the AI chat's empty-message fallback stable. When the last conversation is deleted, or initial thread loading/creation fails, `activeTab` is absent. A fresh `[]` on each render retriggers the quick-prompt effect, which sets another array in state and loops indefinitely. This reuses the existing module-level empty-list pattern: one typed constant and its fallback use, with a single parameterized regression covering the three entry paths and recovery via New Chat. No new dependency, API, automatic retry, or deployment change. Focused commit: [60c05ce3ec](https://github.com/I3eka/superset/commit/60c05ce3ec19cd0480b95b1298c77b727fa357ff). Based exactly on #42805 at `0e4a15cca1c5be2b7e68d609a9062f5e51193024`; the comparison to Apache master includes that unmerged AI implementation. This is a draft follow-up, not a replacement for its SIP-224 discussion/hold. Addresses @sadpandajoe's [empty-tab finding on #43136](https://github.com/apache/superset/pull/43136#discussion_r4050749081), separately from identifier-search changes. It has not been inherited by #43136 or deployed. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF No visual layout change. Before: the real hook fails the bounded render check on the empty-tab paths. After: it settles with suggestions, preserves the empty-message reference while typing, and can create a new conversation that clears the loading error. ### TESTING INSTRUCTIONS - New three-case regression: all three fail before the fix; all three pass afterward. Thread/agent API calls are stubbed; React effects, page context, reducers and hook state are real. The render guard bounds the broken case so it fails instead of hanging. - Four hook/request/page-context Jest suites: **45 passed**. - All nine AI frontend suites: **107 passed, one inherited failure** in `ChatTabsMenu` (`renaming is abandoned on Escape`). That exact failure also reproduces on untouched #42805 (eight other menu tests pass). No full-suite green claim. - Tests use the existing local Jest harness to transform the ESM `content-disposition` dependency; no test configuration change is included in this PR. - Changed-file formatting, lint, custom rules and style checks pass. Type checking reports five errors in unchanged `FoldersEditor`, `exploreUtils` and `ThemeProvider` with the installed dependency/generated-type versions. The same five reproduce on the untouched parent when checking its existing panel tests. No changed AI file has a type diagnostic. - Required repository-wide pre-commit run completed in an isolated worktree. It reports unrelated baseline formatting/lint/type failures and missing Yarn/Helm; both mypy checks, pylint, custom/style rules and metadata/feature checks pass. Its 51 automatic edits are outside these three PR files and were not included. No repository-wide green claim. - `git diff --check` passes. No live-service/browser deployment check or backend behavior change is claimed. Manual checks with the assistant enabled: delete the last conversation, verify the empty panel and suggestions remain usable, then choose New Chat. Repeat after a failed initial list request or initial conversation creation. ### ADDITIONAL INFORMATION - [x] Has associated issue: inline review finding linked above - [x] Required feature flags: `AI_ASSISTANT` from #42805 - [x] Changes UI: empty-state stability only, no visual redesign - [ ] 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]
