-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
SDK 1.25.2 introduced types that break projects using sessionIdGenerator: undefined with strict TypeScript configs.
Errors
error TS2379: Argument of type '{ sessionIdGenerator: undefined; enableJsonResponse: true; }'
is not assignable to parameter of type 'WebStandardStreamableHTTPServerTransportOptions' with
'exactOptionalPropertyTypes: true'.
Types of property 'sessionIdGenerator' are incompatible.
Type 'undefined' is not assignable to type '() => string'.
error TS2379: Argument of type 'StreamableHTTPServerTransport' is not assignable to parameter
of type 'Transport' with 'exactOptionalPropertyTypes: true'.
Types of property 'onclose' are incompatible.
Type '(() => void) | undefined' is not assignable to type '() => void'.
Type 'undefined' is not assignable to type '() => void'.
Cause
Optional properties like sessionIdGenerator?: () => string need to be typed as sessionIdGenerator?: (() => string) | undefined to allow explicitly passing undefined.
Similarly, the Transport interface's onclose property needs the same treatment.
I beleive this was recently changed in #1326
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working