@componentor/fs 3.0.19 → 3.0.21

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.
@@ -2647,6 +2647,8 @@ function writeResponse(targetSab, targetCtrl, responseData) {
2647
2647
  Atomics.store(targetCtrl, 0, SIGNAL.RESPONSE);
2648
2648
  Atomics.notify(targetCtrl, 0);
2649
2649
  } else {
2650
+ const totalView = new BigUint64Array(targetSab, SAB_OFFSETS.TOTAL_LEN, 1);
2651
+ Atomics.store(totalView, 0, BigInt(responseData.byteLength));
2650
2652
  let sent = 0;
2651
2653
  while (sent < responseData.byteLength) {
2652
2654
  const chunkSize = Math.min(maxChunk, responseData.byteLength - sent);
@@ -2700,8 +2702,11 @@ async function leaderLoop() {
2700
2702
  const asyncResult = handleRequest(tabId, payload.buffer);
2701
2703
  writeDirectResponse(asyncSab, asyncCtrl, asyncResult.status, asyncResult.data);
2702
2704
  if (asyncResult._op !== void 0) notifyOPFSSync(asyncResult._op, asyncResult._path, asyncResult._newPath);
2703
- const waitResult = Atomics.wait(asyncCtrl, 0, SIGNAL.RESPONSE, 10);
2704
- if (waitResult === "timed-out") {
2705
+ for (let i = 0; i < 500; i++) {
2706
+ if (Atomics.load(asyncCtrl, 0) === SIGNAL.IDLE) break;
2707
+ Atomics.wait(asyncCtrl, 0, Atomics.load(asyncCtrl, 0), 10);
2708
+ }
2709
+ if (Atomics.load(asyncCtrl, 0) !== SIGNAL.IDLE) {
2705
2710
  Atomics.store(asyncCtrl, 0, SIGNAL.IDLE);
2706
2711
  }
2707
2712
  processed = true;