@ubercode/dcmtk 0.13.1 → 0.13.2

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/dist/index.js CHANGED
@@ -36524,10 +36524,14 @@ var Worker = class {
36524
36524
  this._instancesReceived = 0;
36525
36525
  this._instanceErrors = 0;
36526
36526
  }
36527
- /** Returns the worker to idle and clears all association state. */
36527
+ /**
36528
+ * Returns the worker to idle. Context is intentionally preserved so that
36529
+ * late FILE_RECEIVED events (arriving in a subsequent pipe chunk after
36530
+ * ASSOCIATION_RELEASE) still have valid association info. Context is
36531
+ * cleared on the next {@link beginAssociation} call.
36532
+ */
36528
36533
  endAssociation() {
36529
36534
  this._state = "idle";
36530
- this._context = void 0;
36531
36535
  this._files.length = 0;
36532
36536
  this._fileSizes.length = 0;
36533
36537
  this._outputLines.length = 0;
@@ -37137,7 +37141,9 @@ var DicomReceiver = class _DicomReceiver extends EventEmitter {
37137
37141
  /** Returns worker to idle pool on association complete, emits summary. */
37138
37142
  wireAssociationComplete(worker) {
37139
37143
  worker.dcmrecv.onAssociationComplete((data) => {
37140
- void this.finalizeAssociation(worker, data);
37144
+ setImmediate(() => {
37145
+ void this.finalizeAssociation(worker, data);
37146
+ });
37141
37147
  });
37142
37148
  }
37143
37149
  /** Awaits file ops, emits ASSOCIATION_COMPLETE, awaits parsing, emits ASSOCIATION_FINALIZED. */