























@@ -170,6 +170,7 @@ function hasCurrentMessageDispatchDedupeTargets(params: {
170170const store = createPluginStateSyncKeyedStore<PersistentDedupeEntry>("telegram", {
171171namespace: params.namespace,
172172maxEntries: TELEGRAM_MESSAGE_DISPATCH_DEDUPE_MAX_ENTRIES,
173+defaultTtlMs: TELEGRAM_MESSAGE_DISPATCH_DEDUPE_TTL_MS,
173174env: params.env,
174175});
175176const existingByKey = new Map(store.entries().map((entry) => [entry.key, entry.value]));
@@ -436,7 +437,7 @@ function detectTelegramMessageDispatchLegacyStateMigration(params: {
436437namespace: accountId,
437438}),
438439}));
439-const jsonPlans = sources.flatMap((source) => {
440+const jsonPlans: ChannelLegacyStateMigrationPlan[] = sources.flatMap((source) => {
440441const sourcePath = source.sourcePath;
441442if (!fileExists(sourcePath)) {
442443return [];
@@ -449,6 +450,7 @@ function detectTelegramMessageDispatchLegacyStateMigration(params: {
449450pluginId: "telegram",
450451 namespace,
451452maxEntries: TELEGRAM_MESSAGE_DISPATCH_DEDUPE_MAX_ENTRIES,
453+defaultTtlMs: TELEGRAM_MESSAGE_DISPATCH_DEDUPE_TTL_MS,
452454scopeKey: "",
453455cleanupSource: "rename",
454456preview: `- Telegram message dispatch dedupe: ${sourcePath} → plugin state (${namespace})`,
@@ -476,27 +478,26 @@ function detectTelegramMessageDispatchLegacyStateMigration(params: {
476478) {
477479return jsonPlans;
478480}
479-return [
480- ...jsonPlans,
481-{
482-kind: "plugin-state-import",
483-label: "Telegram message dispatch dedupe",
484-sourcePath: `plugin state:${TELEGRAM_MESSAGE_DISPATCH_LEGACY_BUCKET_NAMESPACE}:${accountId}`,
485-targetPath: `plugin state:${namespace}`,
486-pluginId: "telegram",
487- namespace,
488-maxEntries: TELEGRAM_MESSAGE_DISPATCH_DEDUPE_MAX_ENTRIES,
489-scopeKey: "",
490-preview: `- Telegram message dispatch dedupe: plugin state (${TELEGRAM_MESSAGE_DISPATCH_LEGACY_BUCKET_NAMESPACE}) → plugin state (${namespace})`,
491-shouldReplaceExistingEntry: ({ existingValue, incomingValue }) =>
492-shouldReplacePersistentDedupeEntry({ existingValue, incomingValue }),
493-readEntries: () =>
494-listTelegramLegacyMessageDispatchPluginStateEntries({
495- accountId,
496- env,
497-}),
498-},
499-];
481+const pluginStatePlan: ChannelLegacyStateMigrationPlan = {
482+kind: "plugin-state-import",
483+label: "Telegram message dispatch dedupe",
484+sourcePath: `plugin state:${TELEGRAM_MESSAGE_DISPATCH_LEGACY_BUCKET_NAMESPACE}:${accountId}`,
485+targetPath: `plugin state:${namespace}`,
486+pluginId: "telegram",
487+ namespace,
488+maxEntries: TELEGRAM_MESSAGE_DISPATCH_DEDUPE_MAX_ENTRIES,
489+defaultTtlMs: TELEGRAM_MESSAGE_DISPATCH_DEDUPE_TTL_MS,
490+scopeKey: "",
491+preview: `- Telegram message dispatch dedupe: plugin state (${TELEGRAM_MESSAGE_DISPATCH_LEGACY_BUCKET_NAMESPACE}) → plugin state (${namespace})`,
492+shouldReplaceExistingEntry: ({ existingValue, incomingValue }) =>
493+shouldReplacePersistentDedupeEntry({ existingValue, incomingValue }),
494+readEntries: () =>
495+listTelegramLegacyMessageDispatchPluginStateEntries({
496+ accountId,
497+ env,
498+}),
499+};
500+return [...jsonPlans, pluginStatePlan];
500501});
501502}
502503此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。