trails/apps/journal/app
Ullrich Schäfer e4d01f51ca fix(journal): pg-boss singleton must live on globalThis, not module scope
In production there are two copies of boss.server.ts in the process:
server.ts imports the TypeScript source directly (node
--experimental-strip-types) while route handlers live in the bundled
build/server/index.js with its own module instance. setBoss() from
server.ts wrote a module-local variable the bundle never saw, so EVERY
request-path enqueue failed with 'pg-boss not initialized' and was
swallowed by enqueueOptional's best-effort catch:

- notifications fan-out on activity publish: silently dropped
- komoot bulk-import kick-off: silently dropped
- federation activity push delivery: silently dropped (how we found
  it — flipping an activity public on staging delivered nothing)

Dev never reproduces this: vite serves one module graph. Caught live
during the social-federation staging soak.

Fix: store the instance on globalThis under a Symbol.for() key so both
module copies resolve the same boss.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 23:23:59 +02:00
..
components chore(ts): drop two more redundant casts 2026-05-26 01:02:49 +02:00
hooks Implement notifications + supporting fixes 2026-04-26 01:28:55 +02:00
jobs feat(journal): federation outbox + push delivery to remote followers 2026-06-06 15:32:52 +02:00
lib fix(journal): pg-boss singleton must live on globalThis, not module scope 2026-06-06 23:23:59 +02:00
routes feat(journal): federation outbox + push delivery to remote followers 2026-06-06 15:32:52 +02:00
entry.client.tsx Add legal pages, ToS acceptance, and alpha banner 2026-04-18 00:08:48 +02:00
entry.server.tsx Consolidate Sentry config into shared package; fix inconsistencies 2026-04-18 00:30:09 +02:00
root.tsx fix(journal): remove ineffective dynamic imports 2026-05-24 12:05:08 +02:00
routes.ts feat(journal): federation outbox + push delivery to remote followers 2026-06-06 15:32:52 +02:00