Skip to content

Commit

Permalink
fix: load chat messages for websocket closed chat [WTEL-5515](https:/…
Browse files Browse the repository at this point in the history
  • Loading branch information
dlohvinov committed Nov 26, 2024
1 parent 0adffc2 commit 2964c02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/features/modules/chat/store/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const actions = {
},

OPEN_CHAT: async (context, chat) => {
if (context.state.closed.closedChatsList?.includes(chat)) {
if (context.state.closed.closedChatsList?.includes(chat) && !chat.contact) {

Check failure on line 103 in src/features/modules/chat/store/chat.js

View workflow job for this annotation

GitHub Actions / test

Unhandled error

TypeError: Cannot read properties of undefined (reading 'closedChatsList') ❯ Object.OPEN_CHAT src/features/modules/chat/store/chat.js:103:30 ❯ src/features/modules/chat/store/__tests__/chats.spec.js:93:24 ❯ node_modules/@vitest/runner/dist/index.js:146:14 ❯ node_modules/@vitest/runner/dist/index.js:61:7 ❯ runTest node_modules/@vitest/runner/dist/index.js:960:17 ❯ processTicksAndRejections node:internal/process/task_queues:95:5 ❯ runSuite node_modules/@vitest/runner/dist/index.js:1116:15 ❯ runSuite node_modules/@vitest/runner/dist/index.js:1116:15 ❯ runFiles node_modules/@vitest/runner/dist/index.js:1173:5 ❯ startTests node_modules/@vitest/runner/dist/index.js:1182:3 This error originated in "src/features/modules/chat/store/__tests__/chats.spec.js" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "src/features/modules/chat/store/__tests__/chats.spec.js". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

if (!chat.messages) {
const { items: messages } = await CatalogAPI.getChatMessagesList({ chatId: chat.id });
Expand Down

0 comments on commit 2964c02

Please sign in to comment.