From de118b79b45497bb895853a1fa165476e8b1dfe3 Mon Sep 17 00:00:00 2001 From: Steven Lindsay Date: Tue, 10 Dec 2024 08:58:45 +0000 Subject: [PATCH] Fix: Stop logging the result object. - The log was attempting to dump the whole results object. This would cause a type error `Converting circular structure to JSON` and then stop the messages from being populated. - I have updated the log to correctly dump only the items in the result. --- demo/src/containers/Chat/Chat.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/src/containers/Chat/Chat.tsx b/demo/src/containers/Chat/Chat.tsx index 646d44dd..89fd2b05 100644 --- a/demo/src/containers/Chat/Chat.tsx +++ b/demo/src/containers/Chat/Chat.tsx @@ -3,7 +3,7 @@ import { MessageComponent } from '../../components/MessageComponent'; import { MessageInput } from '../../components/MessageInput'; import { useChatClient, useChatConnection, useMessages, useRoomReactions, useTyping } from '@ably/chat/react'; import { ReactionInput } from '../../components/ReactionInput'; -import { ConnectionStatusComponent } from '../../components/ConnectionStatusComponent/ConnectionStatusComponent.tsx'; +import { ConnectionStatusComponent } from '../../components/ConnectionStatusComponent'; import { ConnectionStatus, Message, MessageEventPayload, MessageEvents, PaginatedResult, Reaction } from '@ably/chat'; export const Chat = (props: { roomId: string; setRoomId: (roomId: string) => void }) => { @@ -20,7 +20,7 @@ export const Chat = (props: { roomId: string; setRoomId: (roomId: string) => voi if (getPreviousMessages) { getPreviousMessages({ limit: 50 }) .then((result: PaginatedResult) => { - chatClient.logger.debug('backfilled messages', result); + chatClient.logger.debug('backfilled messages', result.items); setMessages(result.items.filter((m) => !m.isDeleted).reverse()); setLoading(false); })