@cosmicdrift/kumiko-dev-server 0.305.0 → 0.307.0

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-dev-server",
3
- "version": "0.305.0",
3
+ "version": "0.307.0",
4
4
  "description": "Dev-tooling for Kumiko apps: local dev-server bootstrap (runDevApp), scaffolding, codegen. Its compose-stacks/env-schema subpaths are consumed at prod boot too — see @cosmicdrift/kumiko-server-runtime for the prod runner itself.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -59,10 +59,10 @@
59
59
  "kumiko-upgrade": "./bin/kumiko-upgrade.ts"
60
60
  },
61
61
  "dependencies": {
62
- "@cosmicdrift/kumiko-bundled-features": "0.305.0",
63
- "@cosmicdrift/kumiko-framework": "0.305.0",
64
- "@cosmicdrift/kumiko-headless": "0.305.0",
65
- "@cosmicdrift/kumiko-server-runtime": "0.305.0",
62
+ "@cosmicdrift/kumiko-bundled-features": "0.307.0",
63
+ "@cosmicdrift/kumiko-framework": "0.307.0",
64
+ "@cosmicdrift/kumiko-headless": "0.307.0",
65
+ "@cosmicdrift/kumiko-server-runtime": "0.307.0",
66
66
  "ts-morph": "^28.0.0"
67
67
  },
68
68
  "publishConfig": {
package/src/changes.json CHANGED
@@ -1,4 +1,9 @@
1
1
  [
2
+ {
3
+ "version": "0.307.0",
4
+ "type": "fix",
5
+ "title": "Dev-server job queues no longer collide across parallel boots"
6
+ },
2
7
  {
3
8
  "version": "0.305.0",
4
9
  "type": "improvement",
@@ -849,6 +849,16 @@ export async function createKumikoServer(
849
849
  const devDbName = process.env["KUMIKO_DEV_DB_NAME"];
850
850
  const persistentDb = devDbName !== undefined && devDbName !== "";
851
851
 
852
+ // Redis is shared across boots AND across apps (unlike the per-boot test
853
+ // DB, which is ephemeral or persistent per KUMIKO_DEV_DB_NAME), so every
854
+ // boot needs its own queue-name prefix — otherwise two dev/e2e servers
855
+ // running in parallel drain each other's queues ("Unknown job: ..."). A
856
+ // persistent DB implies a stable prefix so jobs survive a restart; an
857
+ // ephemeral DB gets a fresh prefix per boot, matching the fresh DB.
858
+ const jobQueueNamePrefix = persistentDb
859
+ ? `kumiko-dev-${devDbName}`
860
+ : `kumiko-dev-${crypto.randomUUID()}`;
861
+
852
862
  logInfo(
853
863
  `[kumiko-server] booting Kumiko stack${
854
864
  persistentDb ? ` — persistent DB "${devDbName}"` : " — ephemeral test DB"
@@ -866,9 +876,11 @@ export async function createKumikoServer(
866
876
  effectiveFeatures: options.effectiveFeatures,
867
877
  }),
868
878
  ...(options.extraRoutes !== undefined && { extraRoutes: options.extraRoutes }),
869
- // jobs: {} = enqueuer-only; startDevJobRunners below is the sole
870
- // consumer/cron-scheduler per lane, so runOnBoot/cron jobs don't double-fire.
871
- jobs: {},
879
+ // jobs.consumerLane unset = enqueuer-only; startDevJobRunners below is
880
+ // the sole consumer/cron-scheduler per lane, so runOnBoot/cron jobs
881
+ // don't double-fire. queueNamePrefix keeps this boot's queues isolated
882
+ // from every other dev/e2e server sharing the same Redis.
883
+ jobs: { queueNamePrefix: jobQueueNamePrefix },
872
884
  });
873
885
  await createEventsTable(stack.db);
874
886
  await pushEntityProjectionTables(stack, stack.registry);
@@ -921,6 +933,10 @@ export async function createKumikoServer(
921
933
  // ctx.write/ctx.writeAs/ctx.queryAs inside a dev-run job throw on their
922
934
  // first call (kumiko-framework#2553).
923
935
  dispatcher: stack.dispatcher,
936
+ // Same isolation reasoning as setupTestStack's jobs.queueNamePrefix
937
+ // above — both must use the same prefix so enqueuer and consumer agree
938
+ // on queue names.
939
+ queueNamePrefix: jobQueueNamePrefix,
924
940
  });
925
941
 
926
942
  // Dev user = TestUsers.admin. Demo features are openToAll but the