small fixes after suggested changes

This commit is contained in:
ihrpr 2025-04-17 17:34:15 +01:00
commit 5dba9477ff
No known key found for this signature in database
2 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;