Lines 26-66javascript
27 isCatastrophicSchemaShrink,
28} from "@reventlessdev/reventless-core/src/components/Api/GraphQL_Stitcher.res.mjs";
30 baseFragment as adminBaseFragment,
31 systemCallerFieldNames,
32} from "@reventlessdev/reventless-core/src/admin/AdminApi.res.mjs";
34const COMP = "apiSchemaPush";
36// ── AppSync push primitives (mirror AdminEventCollectorEntryPoint.mjs) ──────────
38const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
40// Push the SDL. Bounded retry on the AppSync API-level lock ("Schema is currently being
41// altered" / ConcurrentModification) — the legacy connect-driven mkUpdateApiSchema still
42// pushes until Plan Phase 4, and a standalone-service push can also contend. The lock
43// clears in seconds, so this is NOT the plan's rejected lagging-read retry (that had no
44// ceiling). The singleton aggregate's single-shard stream already serializes THIS writer
45// against itself; this only covers cross-writer contention.
46async function updateAppSyncSchema(apiId, sdl) {
47 const { AppSyncClient, StartSchemaCreationCommand } = await import("@aws-sdk/client-appsync");
48 const client = new AppSyncClient({});
HighCopied Package Dependency Bridge
Package metadata claims a different repository identity while copied source loads a runtime dependency bridge.
src/adapter/Runtime/ApiSchemaPush_Runtime.mjsView on unpkg · L46 49 const maxAttempts = 6;
50 for (let attempt = 1; ; attempt++) {
52 await client.send(new StartSchemaCreationCommand({ apiId, definition: sdl }));
55 const msg = (e && e.message) || String(e);
56 const locked = /being altered|ConcurrentModification|currently in the process/i.test(msg);
57 if (!locked || attempt >= maxAttempts) throw e;
58 const backoff = Math.min(1000 * 2 ** (attempt - 1), 8000);
59 log.warn(`schema push contended (${msg}) — retry ${attempt}/${maxAttempts} in ${backoff}ms`, { comp: COMP });
65// Current live schema as SDL for the shrink guard. "" (not error) when the API has
66// no schema yet or introspection fails — the caller treats "" as "no baseline".