@droppii-org/chat-sdk 0.6.15 → 0.6.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"useActiveConversation.d.ts","sourceRoot":"","sources":["../../../src/hooks/conversation/useActiveConversation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,eAAO,MAAM,qBAAqB,GAChC,mBAAmB,oBAAoB,EAAE,SAwF1C,CAAC"}
1
+ {"version":3,"file":"useActiveConversation.d.ts","sourceRoot":"","sources":["../../../src/hooks/conversation/useActiveConversation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,eAAO,MAAM,qBAAqB,GAChC,mBAAmB,oBAAoB,EAAE,SAkG1C,CAAC"}
@@ -33,7 +33,17 @@ export const useActiveConversation = (conversationItems) => {
33
33
  clearSelectedConversation();
34
34
  return;
35
35
  }
36
- setSelectedConversationId(threadId);
36
+ // conversationItems changes identity on every list mutation (a message
37
+ // send fires 2+ WS events — optimistic + ack), re-running this effect
38
+ // even though the active thread hasn't changed. setSelectedConversationId
39
+ // resets quotedMessage unconditionally on every call, which cascades into
40
+ // useMessage/usePinnedMessages re-fetching and ahooks' useRequest
41
+ // cancelling+re-running its in-flight request (surfaces as an uncaught
42
+ // CancelledError). Guard against re-selecting the same thread, matching
43
+ // the identity check setConversationData already uses below.
44
+ if (useConversationStore.getState().selectedConversationId !== threadId) {
45
+ setSelectedConversationId(threadId);
46
+ }
37
47
  // Deep link to one message (copy-message-link). Only ever APPLIED, never
38
48
  // cleared from here: an in-app jump (search result, pinned message) sets
39
49
  // searchClientMsgID without touching the URL, and this effect re-runs on
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@droppii-org/chat-sdk",
3
- "version": "0.6.15",
3
+ "version": "0.6.16",
4
4
  "description": "Droppii React Chat SDK",
5
5
  "repository": {
6
6
  "type": "git",