mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-29 19:01:44 +00:00
fix(regression): preserve line pairing account context
This commit is contained in:
@@ -88,6 +88,41 @@ function createRuntime(): { runtime: PluginRuntime; mocks: LineRuntimeMocks } {
|
||||
}
|
||||
|
||||
describe("linePlugin outbound.sendPayload", () => {
|
||||
it("preserves resolved accountId when pairing notifications push directly", async () => {
|
||||
const { runtime, mocks } = createRuntime();
|
||||
setLineRuntime(runtime);
|
||||
const cfg = {
|
||||
channels: {
|
||||
line: {
|
||||
accounts: {
|
||||
primary: {
|
||||
channelAccessToken: "token-primary",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as OpenClawConfig;
|
||||
mocks.resolveLineAccount.mockReturnValue({
|
||||
accountId: "primary",
|
||||
channelAccessToken: "token-primary",
|
||||
config: {},
|
||||
});
|
||||
|
||||
await linePlugin.pairing!.notifyApproval!({
|
||||
cfg,
|
||||
id: "line:user:1",
|
||||
});
|
||||
|
||||
expect(mocks.pushMessageLine).toHaveBeenCalledWith(
|
||||
"line:user:1",
|
||||
"OpenClaw: your access has been approved.",
|
||||
{
|
||||
accountId: "primary",
|
||||
channelAccessToken: "token-primary",
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it("sends flex message without dropping text", async () => {
|
||||
const { runtime, mocks } = createRuntime();
|
||||
setLineRuntime(runtime);
|
||||
|
||||
@@ -291,6 +291,7 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = createChatChannelP
|
||||
throw new Error("LINE channel access token not configured");
|
||||
}
|
||||
await line.pushMessageLine(id, message, {
|
||||
accountId: account.accountId,
|
||||
channelAccessToken: account.channelAccessToken,
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user