Skip to content

Commit e4bda18

Browse files
committed
fix(sdk): detach the session message listener when the turn iterator is abandoned
1 parent e6e9e7b commit e4bda18

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • packages/trigger-sdk/src/v3

packages/trigger-sdk/src/v3/ai.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9766,6 +9766,8 @@ function createChatSession(
97669766
},
97679767

97689768
async return() {
9769+
activeMsgSub?.off();
9770+
activeMsgSub = undefined;
97699771
// `stop` only exists once next() has booted the iterator.
97709772
stop?.cleanup();
97719773
return { done: true, value: undefined };

0 commit comments

Comments
 (0)