@lvce-editor/renderer-process 30.43.4 → 30.43.5

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.
@@ -5611,7 +5611,6 @@ const setIdentifiers = identifiers => {
5611
5611
  setIdentifiers$1(identifiers);
5612
5612
  };
5613
5613
 
5614
- const appliedBatches = new Map();
5615
5614
  const pendingBatches = new Map();
5616
5615
  const state$2 = {
5617
5616
  nextTransactionId: 1
@@ -5620,6 +5619,7 @@ const queue = (uid, commands) => {
5620
5619
  const transactionId = state$2.nextTransactionId++;
5621
5620
  pendingBatches.set(transactionId, {
5622
5621
  commands,
5622
+ committed: false,
5623
5623
  uid
5624
5624
  });
5625
5625
  return transactionId;
@@ -5627,30 +5627,22 @@ const queue = (uid, commands) => {
5627
5627
  const take = (uid, transactionId) => {
5628
5628
  const batch = pendingBatches.get(transactionId);
5629
5629
  if (!batch) {
5630
- const appliedUid = appliedBatches.get(transactionId);
5631
- if (appliedUid !== undefined) {
5632
- if (appliedUid !== uid) {
5633
- throw new Error(`pending viewlet command transaction ${transactionId} belongs to ${appliedUid}, not ${uid}`);
5634
- }
5635
- appliedBatches.delete(transactionId);
5636
- return [];
5637
- }
5638
5630
  throw new Error(`pending viewlet command transaction not found: ${transactionId}`);
5639
5631
  }
5640
5632
  if (batch.uid !== uid) {
5641
5633
  throw new Error(`pending viewlet command transaction ${transactionId} belongs to ${batch.uid}, not ${uid}`);
5642
5634
  }
5635
+ batch.committed = true;
5643
5636
  const commands = [];
5644
5637
  for (const [pendingTransactionId, pendingBatch] of pendingBatches) {
5645
5638
  if (pendingBatch.uid !== uid) {
5646
5639
  continue;
5647
5640
  }
5648
- commands.push(...pendingBatch.commands);
5649
- pendingBatches.delete(pendingTransactionId);
5650
- if (pendingTransactionId === transactionId) {
5641
+ if (!pendingBatch.committed) {
5651
5642
  break;
5652
5643
  }
5653
- appliedBatches.set(pendingTransactionId, uid);
5644
+ commands.push(...pendingBatch.commands);
5645
+ pendingBatches.delete(pendingTransactionId);
5654
5646
  }
5655
5647
  return commands;
5656
5648
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "30.43.4",
3
+ "version": "30.43.5",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"