Skip to content

Commit 5b39fb8

Browse files
committed
fix(chat): fail loudly when record peeking is unsupported
1 parent 49000b6 commit 5b39fb8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • packages/core/src/v3/sessionStreams

packages/core/src/v3/sessionStreams/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ export class SessionStreamsAPI implements SessionStreamManager {
7979
}
8080

8181
public peekRecord(sessionId: string, io: SessionChannelIO): SessionStreamRecord | undefined {
82-
return this.#getManager().peekRecord?.(sessionId, io);
82+
const manager = this.#getManager();
83+
if (!manager.peekRecord) {
84+
throw new Error("The configured Session stream manager does not support record metadata");
85+
}
86+
return manager.peekRecord(sessionId, io);
8387
}
8488

8589
public peekRecordWhere(

0 commit comments

Comments
 (0)