mirror of https://github.com/openclaw/openclaw.git
fix(ci): repair seam drift and matrix test timing
This commit is contained in:
parent
d7ba6d3e68
commit
2416e2d51d
|
|
@ -250,7 +250,8 @@ const resolveDiscordAllowlistGroupOverrides = createNestedAllowlistOverrideResol
|
|||
const resolveDiscordAllowlistNames = createAccountScopedAllowlistNameResolver({
|
||||
resolveAccount: resolveDiscordAccount,
|
||||
resolveToken: (account: ResolvedDiscordAccount) => account.token,
|
||||
resolveNames: ({ token, entries }) => resolveDiscordUserAllowlist({ token, entries }),
|
||||
resolveNames: async ({ token, entries }) =>
|
||||
(await loadDiscordResolveUsersModule()).resolveDiscordUserAllowlist({ token, entries }),
|
||||
});
|
||||
|
||||
const collectDiscordSecurityWarnings =
|
||||
|
|
@ -465,8 +466,8 @@ export const discordPlugin: ChannelPlugin<ResolvedDiscordAccount, DiscordProbe>
|
|||
(await loadDiscordDirectoryConfigModule()).listDiscordDirectoryGroupsFromConfig(params),
|
||||
...createRuntimeDirectoryLiveAdapter({
|
||||
getRuntime: loadDiscordDirectoryLiveModule,
|
||||
listPeersLive: (runtime) => runtime.listDirectoryPeersLive,
|
||||
listGroupsLive: (runtime) => runtime.listDirectoryGroupsLive,
|
||||
listPeersLive: (runtime) => runtime.listDiscordDirectoryPeersLive,
|
||||
listGroupsLive: (runtime) => runtime.listDiscordDirectoryGroupsLive,
|
||||
}),
|
||||
}),
|
||||
resolver: {
|
||||
|
|
|
|||
|
|
@ -194,30 +194,25 @@ describe("registerMatrixMonitorEvents verification routing", () => {
|
|||
});
|
||||
|
||||
it("still posts fresh verification completions", async () => {
|
||||
vi.useFakeTimers();
|
||||
vi.setSystemTime(new Date("2026-03-14T13:10:00.000Z"));
|
||||
try {
|
||||
const { sendMessage, roomEventListener } = createHarness();
|
||||
const { sendMessage, roomEventListener } = createHarness();
|
||||
|
||||
roomEventListener("!room:example.org", {
|
||||
event_id: "$done-fresh",
|
||||
sender: "@alice:example.org",
|
||||
type: "m.key.verification.done",
|
||||
origin_server_ts: Date.now(),
|
||||
content: {
|
||||
"m.relates_to": { event_id: "$req-fresh" },
|
||||
},
|
||||
});
|
||||
roomEventListener("!room:example.org", {
|
||||
event_id: "$done-fresh",
|
||||
sender: "@alice:example.org",
|
||||
type: "m.key.verification.done",
|
||||
origin_server_ts: Date.now(),
|
||||
content: {
|
||||
"m.relates_to": { event_id: "$req-fresh" },
|
||||
},
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(sendMessage).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
expect(getSentNoticeBody(sendMessage)).toContain(
|
||||
"Matrix verification completed with @alice:example.org.",
|
||||
);
|
||||
} finally {
|
||||
vi.useRealTimers();
|
||||
}
|
||||
await vi.dynamicImportSettled();
|
||||
await vi.waitFor(() => {
|
||||
expect(sendMessage).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
expect(getSentNoticeBody(sendMessage)).toContain(
|
||||
"Matrix verification completed with @alice:example.org.",
|
||||
);
|
||||
});
|
||||
|
||||
it("forwards reaction room events into the shared room handler", async () => {
|
||||
|
|
|
|||
|
|
@ -360,8 +360,8 @@ export const slackPlugin: ChannelPlugin<ResolvedSlackAccount, SlackProbe> = crea
|
|||
(await loadSlackDirectoryConfigModule()).listSlackDirectoryGroupsFromConfig(params),
|
||||
...createRuntimeDirectoryLiveAdapter({
|
||||
getRuntime: loadSlackDirectoryLiveModule,
|
||||
listPeersLive: (runtime) => runtime.listDirectoryPeersLive,
|
||||
listGroupsLive: (runtime) => runtime.listDirectoryGroupsLive,
|
||||
listPeersLive: (runtime) => runtime.listSlackDirectoryPeersLive,
|
||||
listGroupsLive: (runtime) => runtime.listSlackDirectoryGroupsLive,
|
||||
}),
|
||||
}),
|
||||
resolver: {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import fs from "node:fs/promises";
|
|||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
|
||||
import type { PluginManifestRegistry } from "../plugins/manifest-registry.js";
|
||||
import { createConfigIO } from "./io.js";
|
||||
import type { OpenClawConfig } from "./types.js";
|
||||
|
||||
|
|
@ -10,14 +11,16 @@ import type { OpenClawConfig } from "./types.js";
|
|||
// test exercise the exact code path that caused the bug: AJV injecting
|
||||
// defaults during the write-back validation pass.
|
||||
const mockLoadPluginManifestRegistry = vi.hoisted(() =>
|
||||
vi.fn(() => ({
|
||||
diagnostics: [],
|
||||
plugins: [],
|
||||
})),
|
||||
vi.fn(
|
||||
(): PluginManifestRegistry => ({
|
||||
diagnostics: [],
|
||||
plugins: [],
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
vi.mock("../plugins/manifest-registry.js", () => ({
|
||||
loadPluginManifestRegistry: (...args: unknown[]) => mockLoadPluginManifestRegistry(...args),
|
||||
loadPluginManifestRegistry: mockLoadPluginManifestRegistry,
|
||||
}));
|
||||
|
||||
describe("config io write", () => {
|
||||
|
|
@ -424,8 +427,17 @@ describe("config io write", () => {
|
|||
plugins: [
|
||||
{
|
||||
id: "bluebubbles",
|
||||
name: "BlueBubbles",
|
||||
version: "0.0.0-test",
|
||||
origin: "bundled",
|
||||
channels: ["bluebubbles"],
|
||||
providers: [],
|
||||
cliBackends: [],
|
||||
skills: [],
|
||||
hooks: [],
|
||||
rootDir: "/mock/bluebubbles",
|
||||
source: "bundled",
|
||||
manifestPath: "/mock/bluebubbles/openclaw.plugin.json",
|
||||
channelCatalogMeta: {
|
||||
id: "bluebubbles",
|
||||
label: "BlueBubbles",
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import type { ChannelAccountSnapshot } from "../channels/plugins/types.core.js";
|
|||
import type { ChannelStatusIssue } from "../channels/plugins/types.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
export type { ChannelAccountSnapshot } from "../channels/plugins/types.core.js";
|
||||
export type { ChannelStatusIssue } from "../channels/plugins/types.js";
|
||||
export { isRecord } from "../channels/plugins/status-issues/shared.js";
|
||||
export {
|
||||
appendMatchMetadata,
|
||||
|
|
|
|||
Loading…
Reference in New Issue