mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 07:24:32 +00:00
fix(slack): map legacy streaming=false to off (openclaw#26020) thanks @chilu18
Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: chilu18 <7957943+chilu18@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -31,4 +31,21 @@ describe("normalizeCompatibilityConfigValues preview streaming aliases", () => {
|
||||
"Normalized channels.discord.streaming boolean → enum (partial).",
|
||||
]);
|
||||
});
|
||||
|
||||
it("normalizes slack boolean streaming aliases to enum and native streaming", () => {
|
||||
const res = normalizeCompatibilityConfigValues({
|
||||
channels: {
|
||||
slack: {
|
||||
streaming: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(res.config.channels?.slack?.streaming).toBe("off");
|
||||
expect(res.config.channels?.slack?.nativeStreaming).toBe(false);
|
||||
expect(res.config.channels?.slack?.streamMode).toBeUndefined();
|
||||
expect(res.changes).toEqual([
|
||||
"Moved channels.slack.streaming (boolean) → channels.slack.nativeStreaming (false).",
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -597,7 +597,7 @@ describe("legacy config detection", () => {
|
||||
},
|
||||
},
|
||||
assert: (config: NonNullable<OpenClawConfig>) => {
|
||||
expect(config.channels?.slack?.streaming).toBe("partial");
|
||||
expect(config.channels?.slack?.streaming).toBe("off");
|
||||
expect(config.channels?.slack?.nativeStreaming).toBe(false);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -121,9 +121,9 @@ export function resolveSlackStreamingMode(
|
||||
if (legacyStreamMode) {
|
||||
return mapSlackLegacyDraftStreamModeToStreaming(legacyStreamMode);
|
||||
}
|
||||
// Legacy `streaming` was a Slack native-streaming toggle; preview mode stayed replace.
|
||||
// Legacy boolean `streaming` values map to the unified enum.
|
||||
if (typeof params.streaming === "boolean") {
|
||||
return "partial";
|
||||
return params.streaming ? "partial" : "off";
|
||||
}
|
||||
return "partial";
|
||||
}
|
||||
|
||||
@@ -40,12 +40,17 @@ describe("resolveSlackStreamingConfig", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("moves legacy streaming boolean to native streaming toggle", () => {
|
||||
it("maps legacy streaming booleans to unified mode and native streaming toggle", () => {
|
||||
expect(resolveSlackStreamingConfig({ streaming: false })).toEqual({
|
||||
mode: "partial",
|
||||
mode: "off",
|
||||
nativeStreaming: false,
|
||||
draftMode: "replace",
|
||||
});
|
||||
expect(resolveSlackStreamingConfig({ streaming: true })).toEqual({
|
||||
mode: "partial",
|
||||
nativeStreaming: true,
|
||||
draftMode: "replace",
|
||||
});
|
||||
});
|
||||
|
||||
it("accepts unified enum values directly", () => {
|
||||
|
||||
Reference in New Issue
Block a user