From 9c2f22e0f8b182cb8efd32915bf2df4280c8f634 Mon Sep 17 00:00:00 2001 From: Suraj Date: Tue, 27 Jan 2026 18:03:25 +0530 Subject: [PATCH 1/2] fix: resolve missing unique key prop warnings in ChatInputFormattingToolbar --- .../ChatInput/ChatInputFormattingToolbar.js | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/packages/react/src/views/ChatInput/ChatInputFormattingToolbar.js b/packages/react/src/views/ChatInput/ChatInputFormattingToolbar.js index 5d8c20a600..1df92d39f8 100644 --- a/packages/react/src/views/ChatInput/ChatInputFormattingToolbar.js +++ b/packages/react/src/views/ChatInput/ChatInputFormattingToolbar.js @@ -1,4 +1,4 @@ -import React, { useState, useRef, useEffect } from 'react'; +import React, { useState, useRef } from 'react'; import { css } from '@emotion/react'; import { Box, @@ -87,7 +87,7 @@ const ChatInputFormattingToolbar = ({ emoji: isPopoverOpen && popOverItems.includes('emoji') ? ( { @@ -116,6 +116,7 @@ const ChatInputFormattingToolbar = ({ audio: ( { @@ -147,7 +149,7 @@ const ChatInputFormattingToolbar = ({ file ) : ( - + { @@ -176,7 +178,7 @@ const ChatInputFormattingToolbar = ({ link ) : ( - + formatter.find((item) => item.name === name)) .map((item) => isPopoverOpen && popOverItems.includes('formatter') ? ( - <> - { + if (isRecordingMessage) return; + handleFormatterClick(item); + }} + css={styles.popOverItemStyles} + > + { - if (isRecordingMessage) return; - handleFormatterClick(item); - }} - css={styles.popOverItemStyles} - > - - {item.name} - - + name={item.name} + size="1rem" + /> + {item.name} + ) : ( handleFormatterClick(itemInFormatter)} css={styles.popOverItemStyles} @@ -296,7 +296,7 @@ const ChatInputFormattingToolbar = ({ setInsertLinkOpen(false)} @@ -360,4 +361,4 @@ const ChatInputFormattingToolbar = ({ ); }; -export default ChatInputFormattingToolbar; +export default ChatInputFormattingToolbar; \ No newline at end of file From c3a809be172a947d831b35ed5be02bb087939f68 Mon Sep 17 00:00:00 2001 From: Suraj Date: Wed, 28 Jan 2026 19:37:37 +0530 Subject: [PATCH 2/2] resolve UI crash on search API 400/429 errors --- .../MessageAggregators/SearchMessages.js | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/packages/react/src/views/MessageAggregators/SearchMessages.js b/packages/react/src/views/MessageAggregators/SearchMessages.js index b4248461c6..b63240b6e9 100644 --- a/packages/react/src/views/MessageAggregators/SearchMessages.js +++ b/packages/react/src/views/MessageAggregators/SearchMessages.js @@ -16,8 +16,17 @@ const SearchMessages = () => { }; const searchMessages = useCallback(async () => { - const { messages } = await RCInstance.getSearchMessages(text); - setMessageList(messages); + try { + // it is capture all responce first and prevent the crash (Error) + const response = await RCInstance.getSearchMessages(text); + + // using the optional chaining and fallback empty array([]) + setMessageList(response?.messages || []); + } catch (error) { + // this is prevent the red-box UI crash , that meens the server are available Until Error (400/429) are Occurs + console.error("Search API Error:", error); + setMessageList([]); + } }, [text, RCInstance]); const debouncedSearch = useCallback( @@ -29,7 +38,8 @@ const SearchMessages = () => { useEffect(() => { if (!text.trim()) { - if (messageList.length > 0) { + // make sure the even check to be safe + if (messageList?.length > 0) { setMessageList([]); } } else { @@ -38,7 +48,7 @@ const SearchMessages = () => { return () => { debouncedSearch.cancel(); }; - }, [text, debouncedSearch, messageList.length]); + }, [text, debouncedSearch, messageList?.length]); return ( { handleInputChange, placeholder: 'Search Messages', }} - searchFiltered={messageList} + // ensure prop is never undefined + searchFiltered={messageList || []} shouldRender={(msg) => !!msg} viewType={viewType} /> ); }; -export default SearchMessages; +export default SearchMessages; \ No newline at end of file