fix: disable repair if not part of retrieval strategy

This commit is contained in:
jm-clius 2025-10-30 13:42:02 +00:00
parent 6a5eac2a85
commit 860ecfaca7
No known key found for this signature in database
GPG Key ID: 5FCD9D5211B952DA

View File

@ -292,7 +292,15 @@ export class ReliableChannel<
decoder: IDecoder<T>,
options?: ReliableChannelOptions
): Promise<ReliableChannel<T>> {
const sdsMessageChannel = new MessageChannel(channelId, senderId, options);
// Enable SDS-R repair only if retrieval strategy uses it
const retrievalStrategy = options?.retrievalStrategy ?? "both";
const enableRepair =
retrievalStrategy === "both" || retrievalStrategy === "sds-r-only";
const sdsMessageChannel = new MessageChannel(channelId, senderId, {
...options,
enableRepair
});
const messageChannel = new ReliableChannel(
node,
sdsMessageChannel,