@teamscala/service-boot 0.23.511 → 0.23.512

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1188,5 +1188,5 @@
1188
1188
  "repository": "https://github.com/teamgbg/service-boot",
1189
1189
  "sideEffects": false,
1190
1190
  "type": "module",
1191
- "version": "0.23.511"
1191
+ "version": "0.23.512"
1192
1192
  }
@@ -82,7 +82,8 @@ describe("mountPgBoss poll-only contract", () => {
82
82
  packages: ["@teamscala/sync-worker"],
83
83
  });
84
84
 
85
- const connectionString = captured?.connectionString ?? "";
85
+ const capturedOpts = captured as unknown as CapturedOpts | undefined;
86
+ const connectionString = capturedOpts?.connectionString ?? "";
86
87
  // The transaction pooler, exactly as injected — the mount adds no
87
88
  // endpoint derivation.
88
89
  expect(connectionString).toContain(":6543");
@@ -93,8 +94,8 @@ describe("mountPgBoss poll-only contract", () => {
93
94
  // The pg sslmode dialect rewrite still applies.
94
95
  expect(connectionString).toContain("sslmode=no-verify");
95
96
  // Poll-only, spelled: no LISTEN dependency, now and after a bump.
96
- expect(captured?.useListenNotify).toBe(false);
97
+ expect(capturedOpts?.useListenNotify).toBe(false);
97
98
  // pg-boss stays a single sibling connection (pool sizing doctrine).
98
- expect(captured?.max).toBe(1);
99
+ expect(capturedOpts?.max).toBe(1);
99
100
  });
100
101
  });
@@ -196,10 +196,15 @@ export async function mountPgBoss(
196
196
  // unavailable" (logged + event-log row), NEVER a boot-crash. A bare
197
197
  // pg-boss assert reaching boot is the violation.
198
198
  let config: ScheduledJobConfig;
199
- try {
200
- config = validateRow("scheduled_job", entry.config) as never as ScheduledJobConfig;
201
- } catch (err) {
202
- const reason = err instanceof Error ? err.message : String(err);
199
+ // validateRow returns a RESULT WRAPPER ({ok:true,value}|{ok:false,issues}),
200
+ // never the config itself — measured 2026-09-16: assigning the wrapper as
201
+ // the config left queue_name/handler_slug undefined and silently skipped
202
+ // EVERY row on services holding db-validation 0.1.289+.
203
+ const validated = validateRow("scheduled_job", entry.config);
204
+ if (!validated.ok) {
205
+ const reason = validated.issues
206
+ .map((i) => `${String(i.path?.map((p) => String(p.key)).join(".") ?? "")}: ${i.message}`)
207
+ .join("; ");
203
208
  log.error(
204
209
  `[pg-boss-mount:${ctx.serviceSlug}] scheduled_job "${entry.slug}" failed schema validation — skipping`,
205
210
  { reason },
@@ -210,6 +215,7 @@ export async function mountPgBoss(
210
215
  });
211
216
  continue;
212
217
  }
218
+ config = validated.value as ScheduledJobConfig;
213
219
  if (!config.queue_name || !config.handler_slug) {
214
220
  log.error(
215
221
  `[pg-boss-mount:${ctx.serviceSlug}] scheduled_job "${entry.slug}" missing queue_name or handler_slug — skipping`,