mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Obs AI Assistant] Fix bug “Cannot set initialMessages if initialConversationId is set" (#189885)
This fixes a bug that occurs with the Insights component when clicking "Start Chat" for a second time. **Reproducing the bug** - Go to any Obs alert and open the insights component - Click "Start Chat" and a flyout with the non-persisted conversation is opened. - Add a new message in order to persist the conversation - Close the flyout - Click "Start Chat" again ``` Error: Cannot set initialMessages if initialConversationId is set at useConversation (http://localhost:5601/fix/XXXXXXXXXXXX/bundles/plugin/observabilityAIAssistantApp/1.0.0/observabilityAIAssistantApp.chunk.0.js:11554:11) at ChatBody (http://localhost:5601/fix/XXXXXXXXXXXX/bundles/plugin/observabilityAIAssistantApp/1.0.0/observabilityAIAssistantApp.chunk.0.js:8112:86) at renderWithHooks (http://localhost:5601/fix/XXXXXXXXXXXX/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:358087:18) at mountIndeterminateComponent (http://localhost:5601/fix/XXXXXXXXXXXX/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:360913:13) at beginWork (http://localhost:5601/fix/XXXXXXXXXXXX/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:362151:16) at HTMLUnknownElement.callCallback (http://localhost:5601/fix/XXXXXXXXXXXX/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:347047:14) at Object.invokeGuardedCallbackDev (http://localhost:5601/fix/XXXXXXXXXXXX/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:347096:16) at invokeGuardedCallback (http://localhost:5601/fix/XXXXXXXXXXXX/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:347158:31) at beginWork$1 (http://localhost:5601/fix/XXXXXXXXXXXX/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:367061:7) at performUnitOfWork (http://localhost:5601/fix/XXXXXXXXXXXX/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:365873:12) ```
This commit is contained in:
parent
66396cf87c
commit
888ca9be87
1 changed files with 1 additions and 0 deletions
|
@ -67,6 +67,7 @@ export function NavControl({}: {}) {
|
|||
|
||||
useEffect(() => {
|
||||
const conversationSubscription = service.conversations.predefinedConversation$.subscribe(() => {
|
||||
keyRef.current = v4();
|
||||
setHasBeenOpened(true);
|
||||
setIsOpen(true);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue