fix(sse): repair RTK engine defaults so dedup and direct calls work (#2825)

Integrated into release/v3.8.6
This commit is contained in:
Lenine Júnior
2026-05-29 04:28:32 -04:00
committed by GitHub
parent 53ac23cfe6
commit 8f4fc8bcda

View File

@@ -316,13 +316,11 @@ export function processRtkText(
}
}
if (config.intensity !== "minimal") {
const deduped = deduplicateRepeatedLines(result, { threshold: config.deduplicateThreshold });
if (deduped.collapsed > 0) {
result = deduped.text;
techniquesUsed.push("rtk-dedup");
rulesApplied.push("rtk:dedup");
}
const deduped = deduplicateRepeatedLines(result, { threshold: config.deduplicateThreshold });
if (deduped.collapsed > 0) {
result = deduped.text;
techniquesUsed.push("rtk-dedup");
rulesApplied.push("rtk:dedup");
}
const truncated = smartTruncate(result, {
@@ -441,7 +439,10 @@ export function applyRtkCompression(
options.stepConfig && options.stepConfig.enabled === undefined
? { enabled: true, ...options.stepConfig }
: options.stepConfig;
const config = mergeRtkConfig(options.config, stepConfig);
const explicitConfig = options.config && Object.keys(options.config).length > 0;
const baseConfig =
!explicitConfig && !stepConfig ? { enabled: true } : (options.config ?? {});
const config = mergeRtkConfig(baseConfig, stepConfig);
if (!config.enabled) return { body, compressed: false, stats: null };
const adapter = adaptBodyForCompression(body);