@pmate/chat-sdk 0.12.0-next.94 → 0.12.0-next.95

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.
@@ -904,6 +904,10 @@ export class ChatSession {
904
904
  }
905
905
  async conversationFailure(error, threadId) {
906
906
  const failure = asChatError(error);
907
+ // A cancelled child read can settle after close. It no longer has authority
908
+ // to retire the shared Team cache or report failures to its live parent.
909
+ if (!this.active)
910
+ return this.closed ? asChatError(new Error("CHAT_SESSION_CLOSED")) : failure;
907
911
  if (failure.code !== "access-denied" && failure.status !== 401)
908
912
  return failure;
909
913
  if (isScopedGroupDenial(error))
@@ -917,6 +921,9 @@ export class ChatSession {
917
921
  }
918
922
  catch { }
919
923
  }
924
+ // Scope revalidation above yields; closing during it is cancellation too.
925
+ if (!this.active)
926
+ return this.closed ? asChatError(new Error("CHAT_SESSION_CLOSED")) : failure;
920
927
  void this.revokeAccess().catch(error => this.options.onError(error));
921
928
  return failure;
922
929
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/chat-sdk",
3
- "version": "0.12.0-next.94",
3
+ "version": "0.12.0-next.95",
4
4
  "description": "Local-first chat SDK, message subscriptions, reading state, and shared chat UI primitives",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",