-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on
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
aldipower
Metadata
Metadata
Assignees
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on