MSTeams: dedupe sent-message cache storage (#22514)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 88e14dcbe1
Co-authored-by: TaKO8Ki <41065217+TaKO8Ki@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
This commit is contained in:
Takayuki Maeda
2026-02-21 16:57:50 +09:00
committed by GitHub
parent f4a59eb5d8
commit 0bee3f337a
2 changed files with 4 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ Docs: https://docs.openclaw.ai
- Security/Unused Dependencies: fix A2UI bundle resolution for removed root `lit` deps by resolving `lit`, `@lit/context`, `@lit-labs/signals`, and `signal-utils` from UI workspace dependencies in `rolldown.config.mjs` during bundling. (#22481) Thanks @vincentkoc.
- Security/Unused Dependencies: simplify `canvas-a2ui` bundling script by removing temporary vendored `node_modules` symlink logic now that `ui` workspace dependencies are explicit. (#22481) Thanks @vincentkoc.
- Security/Unused Dependencies: remove unused `@microsoft/agents-hosting-express` and `@microsoft/agents-hosting-extensions-teams` from `extensions/msteams` because current code only uses `@microsoft/agents-hosting`. Thanks @vincentkoc.
- MSTeams: dedupe sent-message cache storage by removing duplicate per-message Set storage and using timestamps Map keys as the single membership source. (#22514) Thanks @TaKO8Ki.
- Security/Unused Dependencies: remove unused plugin-local `openclaw` devDependencies from `extensions/open-prose`, `extensions/lobster`, and `extensions/llm-task` after removing this dependency from build-time requirements. (#22495) Thanks @vincentkoc.
- Agents/Subagents: default subagent spawn depth now uses shared `maxSpawnDepth=2`, enabling depth-1 orchestrator spawning by default while keeping depth policy checks consistent across spawn and prompt paths. (#22223) Thanks @tyler6204.
- Channels/CLI: add per-account/channel `defaultTo` outbound routing fallback so `openclaw agent --deliver` can send without explicit `--reply-to` when a default target is configured. (#16985) Thanks @KirillShchetinin.

View File

@@ -1,7 +1,6 @@
const TTL_MS = 24 * 60 * 60 * 1000; // 24 hours
type CacheEntry = {
messageIds: Set<string>;
timestamps: Map<string, number>;
};
@@ -11,7 +10,6 @@ function cleanupExpired(entry: CacheEntry): void {
const now = Date.now();
for (const [msgId, timestamp] of entry.timestamps) {
if (now - timestamp > TTL_MS) {
entry.messageIds.delete(msgId);
entry.timestamps.delete(msgId);
}
}
@@ -23,12 +21,11 @@ export function recordMSTeamsSentMessage(conversationId: string, messageId: stri
}
let entry = sentMessages.get(conversationId);
if (!entry) {
entry = { messageIds: new Set(), timestamps: new Map() };
entry = { timestamps: new Map() };
sentMessages.set(conversationId, entry);
}
entry.messageIds.add(messageId);
entry.timestamps.set(messageId, Date.now());
if (entry.messageIds.size > 200) {
if (entry.timestamps.size > 200) {
cleanupExpired(entry);
}
}
@@ -39,7 +36,7 @@ export function wasMSTeamsMessageSent(conversationId: string, messageId: string)
return false;
}
cleanupExpired(entry);
return entry.messageIds.has(messageId);
return entry.timestamps.has(messageId);
}
export function clearMSTeamsSentMessageCache(): void {