Merge branch 'main' into ihrpr/backwards_compatibility

This commit is contained in:
ihrpr 2025-04-17 17:37:33 +01:00
commit 9e6041135b
No known key found for this signature in database
3 changed files with 3 additions and 10 deletions

View file

@ -169,11 +169,7 @@ describe("StreamableHTTPClientTransport", () => {
headers: new Headers()
});
// This should not throw an error
await transport.terminateSession();
// The session ID should still be preserved since termination wasn't accepted
expect(transport.sessionId).toBe("test-session-id");
await expect(transport.terminateSession()).resolves.not.toThrow();
});
it("should handle 404 response when session expires", async () => {

View file

@ -505,10 +505,7 @@ export class StreamableHTTPClientTransport implements Transport {
);
}
// If session termination was successful, clear our session ID
if (response.ok) {
this._sessionId = undefined;
}
this._sessionId = undefined;
} catch (error) {
this.onerror?.(error as Error);
throw error;

View file

@ -42,7 +42,7 @@ export interface StreamableHTTPServerTransportOptions {
/**
* A callback for session initialization events
* This is called when the server initializes a new session.
* Usefult in cases when you need to register multiple mcp sessions
* Useful in cases when you need to register multiple mcp sessions
* and need to keep track of them.
* @param sessionId The generated session ID
*/