




















@@ -178,6 +178,32 @@ function areJsonValuesEqual(left: unknown, right: unknown): boolean {
178178return false;
179179}
180180181+function withoutQaConfigApplyVolatileFields(
182+config: Record<string, unknown>,
183+): Record<string, unknown> {
184+const comparable = structuredClone(config);
185+// config.apply updates root metadata on write. Retries should not turn a
186+// completed apply into a metadata-only write/restart loop.
187+delete comparable.meta;
188+return comparable;
189+}
190+191+function isConfigApplyNoopForSnapshot(config: Record<string, unknown>, raw: string): boolean {
192+let nextConfig: unknown;
193+try {
194+nextConfig = JSON.parse(raw);
195+} catch {
196+return false;
197+}
198+if (!isPlainObject(nextConfig)) {
199+return false;
200+}
201+return areJsonValuesEqual(
202+withoutQaConfigApplyVolatileFields(config),
203+withoutQaConfigApplyVolatileFields(nextConfig),
204+);
205+}
206+181207function isConfigPatchNoopForSnapshot(config: Record<string, unknown>, raw: string): boolean {
182208let patch: unknown;
183209try {
@@ -233,6 +259,12 @@ async function runConfigMutation(params: {
233259// control-plane write budget and making later capability checks flaky.
234260return { ok: true, noop: true };
235261}
262+if (
263+params.action === "config.apply" &&
264+isConfigApplyNoopForSnapshot(snapshot.config, params.raw)
265+) {
266+return { ok: true, noop: true };
267+}
236268try {
237269const result = await params.env.gateway.call(
238270params.action,
@@ -327,6 +359,7 @@ export {
327359fetchJson,
328360formatGatewayPrimaryErrorText,
329361getGatewayRetryAfterMs,
362+isConfigApplyNoopForSnapshot,
330363isConfigPatchNoopForSnapshot,
331364isConfigHashConflict,
332365isGatewayRestartRace,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。