@workerdeck/server 2.2.1 → 2.3.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/build/index.mjs CHANGED
@@ -2571,7 +2571,10 @@ var SessionParkManager = class {
2571
2571
  throw error;
2572
2572
  }
2573
2573
  this.#options.registry.register(runner);
2574
- this.remember(id, record.config);
2574
+ this.remember(id, {
2575
+ ...record.config,
2576
+ epoch: runner.info().epoch
2577
+ });
2575
2578
  this.watch(runner, isDormant(record) ? 0 : record.snapshot.seq);
2576
2579
  this.#options.onResumed?.(id, runner);
2577
2580
  if (!isDormant(record) && !isLiveRecord(record)) await this.#queue(id, () => this.#options.store.delete(id));
@@ -3156,15 +3159,18 @@ function createWorkerServer(options = {}) {
3156
3159
  expiredGraceMs: options.parking?.expiredGraceMs,
3157
3160
  persistLive: options.parking?.persistLive,
3158
3161
  onError: options.parking?.onError,
3159
- rebuild: (record) => isDormant(record) ? factory.buildRunner(factory.buildRunnerConfig({
3160
- ...record.config,
3161
- prompt: void 0,
3162
- meta: record.info.title ? {
3163
- ...record.config.meta,
3164
- title: record.info.title
3165
- } : record.config.meta,
3166
- resume: record.sdkSessionId
3167
- }), void 0, record.id) : factory.buildRunner(record.config, record.snapshot),
3162
+ rebuild: (record) => isDormant(record) ? factory.buildRunner({
3163
+ ...factory.buildRunnerConfig({
3164
+ ...record.config,
3165
+ prompt: void 0,
3166
+ meta: record.info.title ? {
3167
+ ...record.config.meta,
3168
+ title: record.info.title
3169
+ } : record.config.meta,
3170
+ resume: record.sdkSessionId
3171
+ }),
3172
+ epoch: (record.info.epoch ?? 0) + 1
3173
+ }, void 0, record.id) : factory.buildRunner(record.config, record.snapshot),
3168
3174
  attachedCount: (sessionId) => bridge.attachedCount(sessionId),
3169
3175
  onParking: (sessionId, executionId) => queue?.onSessionParking(sessionId, executionId) ?? true,
3170
3176
  onResumed: (sessionId, runner) => queue?.onSessionResumed(sessionId, runner)