fix: Ensure _meta object is not lost when onprogress option is passed

When the onprogress option is passed, the _meta object in the request
params was being overwritten, causing any existing _meta content to be lost.
This commit is contained in:
PapacyDai 2025-05-29 15:15:52 +08:00 • committed by GitHub
commit 49777d5652
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -541,7 +541,10 @@ export abstract class Protocol<
this._progressHandlers.set(messageId, options.onprogress);
jsonrpcRequest.params = {
...request.params,
_meta: { progressToken: messageId },
_meta: {
...(request.params._meta || {}),
progressToken: messageId
},
};
}