From 1ec723d1cafac6f60bb54a6aa73616e183479776 Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Tue, 6 Jan 2026 11:56:01 -0800 Subject: [PATCH] Fix issue where we tried to fetch chats for a logged out user --- packages/common/src/store/pages/chat/sagas.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/common/src/store/pages/chat/sagas.ts b/packages/common/src/store/pages/chat/sagas.ts index af40dcf4523..4d817b1a381 100644 --- a/packages/common/src/store/pages/chat/sagas.ts +++ b/packages/common/src/store/pages/chat/sagas.ts @@ -144,7 +144,9 @@ function* doFetchLatestChats() { let firstResponse: TypedCommsResponse | undefined const currentUserId = yield* call(queryCurrentUserId) if (!currentUserId) { - throw new Error('User not found') + // User is logged out - this is expected, don't report to Sentry + yield* put(fetchMoreChatsFailed()) + return } while (hasMoreChats) { const response = yield* call([sdk.chats, sdk.chats.getAll], { @@ -186,7 +188,9 @@ function* doFetchMoreChats() { const before = summary?.prev_cursor const currentUserId = yield* call(queryCurrentUserId) if (!currentUserId) { - throw new Error('User not found') + // User is logged out - this is expected, don't report to Sentry + yield* put(fetchMoreChatsFailed()) + return } const response = yield* call([sdk.chats, sdk.chats.getAll], { userId: Id.parse(currentUserId),