houdini 1.5.7 → 1.5.9

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.
@@ -69673,20 +69673,21 @@ var CacheInternal = class {
69673
69673
  }
69674
69674
  } else if (Array.isArray(value) && (typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
69675
69675
  let oldIDs = [...previousValue || []];
69676
- const emptyEdges = !updates ? [] : oldIDs.map((id) => {
69677
- if (!id) {
69678
- return "";
69679
- }
69680
- const { value: cursorField } = this.storage.get(id, "cursor");
69681
- if (cursorField) {
69682
- return "";
69683
- }
69684
- const { value: node } = this.storage.get(id, "node");
69685
- if (!node) {
69686
- return "";
69687
- }
69688
- return node;
69689
- });
69676
+ if (updates?.includes("append") || updates?.includes("prepend")) {
69677
+ oldIDs = oldIDs.filter((id) => {
69678
+ for (const layer2 of this.storage.data) {
69679
+ for (const operation of Object.values(layer2.operations)) {
69680
+ if (operation.fields?.[key])
69681
+ for (const listOperation of operation.fields[key]) {
69682
+ if ("id" in listOperation && listOperation.id === id) {
69683
+ return false;
69684
+ }
69685
+ }
69686
+ }
69687
+ }
69688
+ return true;
69689
+ });
69690
+ }
69690
69691
  let linkedIDs = [];
69691
69692
  const { newIDs, nestedIDs } = this.extractNestedListIDs({
69692
69693
  value,
@@ -69705,39 +69706,45 @@ var CacheInternal = class {
69705
69706
  layer.writeLink(parent, key, linkedIDs);
69706
69707
  };
69707
69708
  if (applyUpdates && updates) {
69708
- if (key === "edges") {
69709
- const newNodeIDs = [];
69710
- for (const id of newIDs) {
69709
+ const filterIDs = (keep, insert) => {
69710
+ const existingIDs = /* @__PURE__ */ new Set();
69711
+ for (const id of keep) {
69711
69712
  if (!id) {
69712
69713
  continue;
69713
69714
  }
69714
69715
  const { value: node } = this.storage.get(id, "node");
69715
- if (typeof node !== "string") {
69716
+ if (!node) {
69716
69717
  continue;
69717
69718
  }
69718
- if (!node || !this.storage.get(node, "__typename")) {
69719
+ const nodeID = this.storage.get(node, "id");
69720
+ if (!nodeID) {
69719
69721
  continue;
69720
69722
  }
69721
- newNodeIDs.push(node);
69723
+ existingIDs.add(nodeID.value);
69722
69724
  }
69723
- oldIDs = oldIDs.filter((id) => {
69725
+ return insert.filter((id) => {
69724
69726
  if (!id) {
69725
69727
  return true;
69726
69728
  }
69727
- const { value: value2 } = this.storage.get(id, "node");
69728
- const node = value2;
69729
- if (newNodeIDs.includes(node) && emptyEdges.includes(node)) {
69730
- return false;
69729
+ const { value: node } = this.storage.get(id, "node");
69730
+ if (!node) {
69731
+ return true;
69731
69732
  }
69732
- return true;
69733
+ const nodeID = this.storage.get(node, "id");
69734
+ if (!nodeID) {
69735
+ return true;
69736
+ }
69737
+ return !existingIDs.has(nodeID.value);
69733
69738
  });
69734
- }
69739
+ };
69735
69740
  for (const update of applyUpdates) {
69736
69741
  if (update !== "replace" && !updates.includes(update)) {
69737
69742
  continue;
69738
69743
  }
69739
69744
  if (update === "prepend") {
69740
- linkedIDs = newIDs.concat(oldIDs);
69745
+ linkedIDs = newIDs.concat(
69746
+ filterIDs(newIDs, oldIDs)
69747
+ );
69741
69748
  if (layer?.optimistic) {
69742
69749
  action = () => {
69743
69750
  for (const id of newIDs) {
@@ -69748,7 +69755,7 @@ var CacheInternal = class {
69748
69755
  };
69749
69756
  }
69750
69757
  } else if (update === "append") {
69751
- linkedIDs = oldIDs.concat(newIDs);
69758
+ linkedIDs = filterIDs(newIDs, oldIDs).concat(newIDs);
69752
69759
  if (layer?.optimistic) {
69753
69760
  action = () => {
69754
69761
  for (const id of newIDs) {
@@ -399,20 +399,21 @@ class CacheInternal {
399
399
  }
400
400
  } else if (Array.isArray(value) && (typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
401
401
  let oldIDs = [...previousValue || []];
402
- const emptyEdges = !updates ? [] : oldIDs.map((id) => {
403
- if (!id) {
404
- return "";
405
- }
406
- const { value: cursorField } = this.storage.get(id, "cursor");
407
- if (cursorField) {
408
- return "";
409
- }
410
- const { value: node } = this.storage.get(id, "node");
411
- if (!node) {
412
- return "";
413
- }
414
- return node;
415
- });
402
+ if (updates?.includes("append") || updates?.includes("prepend")) {
403
+ oldIDs = oldIDs.filter((id) => {
404
+ for (const layer2 of this.storage.data) {
405
+ for (const operation of Object.values(layer2.operations)) {
406
+ if (operation.fields?.[key])
407
+ for (const listOperation of operation.fields[key]) {
408
+ if ("id" in listOperation && listOperation.id === id) {
409
+ return false;
410
+ }
411
+ }
412
+ }
413
+ }
414
+ return true;
415
+ });
416
+ }
416
417
  let linkedIDs = [];
417
418
  const { newIDs, nestedIDs } = this.extractNestedListIDs({
418
419
  value,
@@ -431,39 +432,45 @@ class CacheInternal {
431
432
  layer.writeLink(parent, key, linkedIDs);
432
433
  };
433
434
  if (applyUpdates && updates) {
434
- if (key === "edges") {
435
- const newNodeIDs = [];
436
- for (const id of newIDs) {
435
+ const filterIDs = (keep, insert) => {
436
+ const existingIDs = /* @__PURE__ */ new Set();
437
+ for (const id of keep) {
437
438
  if (!id) {
438
439
  continue;
439
440
  }
440
441
  const { value: node } = this.storage.get(id, "node");
441
- if (typeof node !== "string") {
442
+ if (!node) {
442
443
  continue;
443
444
  }
444
- if (!node || !this.storage.get(node, "__typename")) {
445
+ const nodeID = this.storage.get(node, "id");
446
+ if (!nodeID) {
445
447
  continue;
446
448
  }
447
- newNodeIDs.push(node);
449
+ existingIDs.add(nodeID.value);
448
450
  }
449
- oldIDs = oldIDs.filter((id) => {
451
+ return insert.filter((id) => {
450
452
  if (!id) {
451
453
  return true;
452
454
  }
453
- const { value: value2 } = this.storage.get(id, "node");
454
- const node = value2;
455
- if (newNodeIDs.includes(node) && emptyEdges.includes(node)) {
456
- return false;
455
+ const { value: node } = this.storage.get(id, "node");
456
+ if (!node) {
457
+ return true;
458
+ }
459
+ const nodeID = this.storage.get(node, "id");
460
+ if (!nodeID) {
461
+ return true;
457
462
  }
458
- return true;
463
+ return !existingIDs.has(nodeID.value);
459
464
  });
460
- }
465
+ };
461
466
  for (const update of applyUpdates) {
462
467
  if (update !== "replace" && !updates.includes(update)) {
463
468
  continue;
464
469
  }
465
470
  if (update === "prepend") {
466
- linkedIDs = newIDs.concat(oldIDs);
471
+ linkedIDs = newIDs.concat(
472
+ filterIDs(newIDs, oldIDs)
473
+ );
467
474
  if (layer?.optimistic) {
468
475
  action = () => {
469
476
  for (const id of newIDs) {
@@ -474,7 +481,7 @@ class CacheInternal {
474
481
  };
475
482
  }
476
483
  } else if (update === "append") {
477
- linkedIDs = oldIDs.concat(newIDs);
484
+ linkedIDs = filterIDs(newIDs, oldIDs).concat(newIDs);
478
485
  if (layer?.optimistic) {
479
486
  action = () => {
480
487
  for (const id of newIDs) {
@@ -372,20 +372,21 @@ class CacheInternal {
372
372
  }
373
373
  } else if (Array.isArray(value) && (typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
374
374
  let oldIDs = [...previousValue || []];
375
- const emptyEdges = !updates ? [] : oldIDs.map((id) => {
376
- if (!id) {
377
- return "";
378
- }
379
- const { value: cursorField } = this.storage.get(id, "cursor");
380
- if (cursorField) {
381
- return "";
382
- }
383
- const { value: node } = this.storage.get(id, "node");
384
- if (!node) {
385
- return "";
386
- }
387
- return node;
388
- });
375
+ if (updates?.includes("append") || updates?.includes("prepend")) {
376
+ oldIDs = oldIDs.filter((id) => {
377
+ for (const layer2 of this.storage.data) {
378
+ for (const operation of Object.values(layer2.operations)) {
379
+ if (operation.fields?.[key])
380
+ for (const listOperation of operation.fields[key]) {
381
+ if ("id" in listOperation && listOperation.id === id) {
382
+ return false;
383
+ }
384
+ }
385
+ }
386
+ }
387
+ return true;
388
+ });
389
+ }
389
390
  let linkedIDs = [];
390
391
  const { newIDs, nestedIDs } = this.extractNestedListIDs({
391
392
  value,
@@ -404,39 +405,45 @@ class CacheInternal {
404
405
  layer.writeLink(parent, key, linkedIDs);
405
406
  };
406
407
  if (applyUpdates && updates) {
407
- if (key === "edges") {
408
- const newNodeIDs = [];
409
- for (const id of newIDs) {
408
+ const filterIDs = (keep, insert) => {
409
+ const existingIDs = /* @__PURE__ */ new Set();
410
+ for (const id of keep) {
410
411
  if (!id) {
411
412
  continue;
412
413
  }
413
414
  const { value: node } = this.storage.get(id, "node");
414
- if (typeof node !== "string") {
415
+ if (!node) {
415
416
  continue;
416
417
  }
417
- if (!node || !this.storage.get(node, "__typename")) {
418
+ const nodeID = this.storage.get(node, "id");
419
+ if (!nodeID) {
418
420
  continue;
419
421
  }
420
- newNodeIDs.push(node);
422
+ existingIDs.add(nodeID.value);
421
423
  }
422
- oldIDs = oldIDs.filter((id) => {
424
+ return insert.filter((id) => {
423
425
  if (!id) {
424
426
  return true;
425
427
  }
426
- const { value: value2 } = this.storage.get(id, "node");
427
- const node = value2;
428
- if (newNodeIDs.includes(node) && emptyEdges.includes(node)) {
429
- return false;
428
+ const { value: node } = this.storage.get(id, "node");
429
+ if (!node) {
430
+ return true;
431
+ }
432
+ const nodeID = this.storage.get(node, "id");
433
+ if (!nodeID) {
434
+ return true;
430
435
  }
431
- return true;
436
+ return !existingIDs.has(nodeID.value);
432
437
  });
433
- }
438
+ };
434
439
  for (const update of applyUpdates) {
435
440
  if (update !== "replace" && !updates.includes(update)) {
436
441
  continue;
437
442
  }
438
443
  if (update === "prepend") {
439
- linkedIDs = newIDs.concat(oldIDs);
444
+ linkedIDs = newIDs.concat(
445
+ filterIDs(newIDs, oldIDs)
446
+ );
440
447
  if (layer?.optimistic) {
441
448
  action = () => {
442
449
  for (const id of newIDs) {
@@ -447,7 +454,7 @@ class CacheInternal {
447
454
  };
448
455
  }
449
456
  } else if (update === "append") {
450
- linkedIDs = oldIDs.concat(newIDs);
457
+ linkedIDs = filterIDs(newIDs, oldIDs).concat(newIDs);
451
458
  if (layer?.optimistic) {
452
459
  action = () => {
453
460
  for (const id of newIDs) {
@@ -60149,20 +60149,21 @@ var CacheInternal = class {
60149
60149
  }
60150
60150
  } else if (Array.isArray(value) && (typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
60151
60151
  let oldIDs = [...previousValue || []];
60152
- const emptyEdges = !updates ? [] : oldIDs.map((id) => {
60153
- if (!id) {
60154
- return "";
60155
- }
60156
- const { value: cursorField } = this.storage.get(id, "cursor");
60157
- if (cursorField) {
60158
- return "";
60159
- }
60160
- const { value: node } = this.storage.get(id, "node");
60161
- if (!node) {
60162
- return "";
60163
- }
60164
- return node;
60165
- });
60152
+ if (updates?.includes("append") || updates?.includes("prepend")) {
60153
+ oldIDs = oldIDs.filter((id) => {
60154
+ for (const layer2 of this.storage.data) {
60155
+ for (const operation of Object.values(layer2.operations)) {
60156
+ if (operation.fields?.[key])
60157
+ for (const listOperation of operation.fields[key]) {
60158
+ if ("id" in listOperation && listOperation.id === id) {
60159
+ return false;
60160
+ }
60161
+ }
60162
+ }
60163
+ }
60164
+ return true;
60165
+ });
60166
+ }
60166
60167
  let linkedIDs = [];
60167
60168
  const { newIDs, nestedIDs } = this.extractNestedListIDs({
60168
60169
  value,
@@ -60181,39 +60182,45 @@ var CacheInternal = class {
60181
60182
  layer.writeLink(parent2, key, linkedIDs);
60182
60183
  };
60183
60184
  if (applyUpdates && updates) {
60184
- if (key === "edges") {
60185
- const newNodeIDs = [];
60186
- for (const id of newIDs) {
60185
+ const filterIDs = (keep, insert) => {
60186
+ const existingIDs = /* @__PURE__ */ new Set();
60187
+ for (const id of keep) {
60187
60188
  if (!id) {
60188
60189
  continue;
60189
60190
  }
60190
60191
  const { value: node } = this.storage.get(id, "node");
60191
- if (typeof node !== "string") {
60192
+ if (!node) {
60192
60193
  continue;
60193
60194
  }
60194
- if (!node || !this.storage.get(node, "__typename")) {
60195
+ const nodeID = this.storage.get(node, "id");
60196
+ if (!nodeID) {
60195
60197
  continue;
60196
60198
  }
60197
- newNodeIDs.push(node);
60199
+ existingIDs.add(nodeID.value);
60198
60200
  }
60199
- oldIDs = oldIDs.filter((id) => {
60201
+ return insert.filter((id) => {
60200
60202
  if (!id) {
60201
60203
  return true;
60202
60204
  }
60203
- const { value: value2 } = this.storage.get(id, "node");
60204
- const node = value2;
60205
- if (newNodeIDs.includes(node) && emptyEdges.includes(node)) {
60206
- return false;
60205
+ const { value: node } = this.storage.get(id, "node");
60206
+ if (!node) {
60207
+ return true;
60207
60208
  }
60208
- return true;
60209
+ const nodeID = this.storage.get(node, "id");
60210
+ if (!nodeID) {
60211
+ return true;
60212
+ }
60213
+ return !existingIDs.has(nodeID.value);
60209
60214
  });
60210
- }
60215
+ };
60211
60216
  for (const update of applyUpdates) {
60212
60217
  if (update !== "replace" && !updates.includes(update)) {
60213
60218
  continue;
60214
60219
  }
60215
60220
  if (update === "prepend") {
60216
- linkedIDs = newIDs.concat(oldIDs);
60221
+ linkedIDs = newIDs.concat(
60222
+ filterIDs(newIDs, oldIDs)
60223
+ );
60217
60224
  if (layer?.optimistic) {
60218
60225
  action = () => {
60219
60226
  for (const id of newIDs) {
@@ -60224,7 +60231,7 @@ var CacheInternal = class {
60224
60231
  };
60225
60232
  }
60226
60233
  } else if (update === "append") {
60227
- linkedIDs = oldIDs.concat(newIDs);
60234
+ linkedIDs = filterIDs(newIDs, oldIDs).concat(newIDs);
60228
60235
  if (layer?.optimistic) {
60229
60236
  action = () => {
60230
60237
  for (const id of newIDs) {
@@ -60146,20 +60146,21 @@ var CacheInternal = class {
60146
60146
  }
60147
60147
  } else if (Array.isArray(value) && (typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
60148
60148
  let oldIDs = [...previousValue || []];
60149
- const emptyEdges = !updates ? [] : oldIDs.map((id) => {
60150
- if (!id) {
60151
- return "";
60152
- }
60153
- const { value: cursorField } = this.storage.get(id, "cursor");
60154
- if (cursorField) {
60155
- return "";
60156
- }
60157
- const { value: node } = this.storage.get(id, "node");
60158
- if (!node) {
60159
- return "";
60160
- }
60161
- return node;
60162
- });
60149
+ if (updates?.includes("append") || updates?.includes("prepend")) {
60150
+ oldIDs = oldIDs.filter((id) => {
60151
+ for (const layer2 of this.storage.data) {
60152
+ for (const operation of Object.values(layer2.operations)) {
60153
+ if (operation.fields?.[key])
60154
+ for (const listOperation of operation.fields[key]) {
60155
+ if ("id" in listOperation && listOperation.id === id) {
60156
+ return false;
60157
+ }
60158
+ }
60159
+ }
60160
+ }
60161
+ return true;
60162
+ });
60163
+ }
60163
60164
  let linkedIDs = [];
60164
60165
  const { newIDs, nestedIDs } = this.extractNestedListIDs({
60165
60166
  value,
@@ -60178,39 +60179,45 @@ var CacheInternal = class {
60178
60179
  layer.writeLink(parent2, key, linkedIDs);
60179
60180
  };
60180
60181
  if (applyUpdates && updates) {
60181
- if (key === "edges") {
60182
- const newNodeIDs = [];
60183
- for (const id of newIDs) {
60182
+ const filterIDs = (keep, insert) => {
60183
+ const existingIDs = /* @__PURE__ */ new Set();
60184
+ for (const id of keep) {
60184
60185
  if (!id) {
60185
60186
  continue;
60186
60187
  }
60187
60188
  const { value: node } = this.storage.get(id, "node");
60188
- if (typeof node !== "string") {
60189
+ if (!node) {
60189
60190
  continue;
60190
60191
  }
60191
- if (!node || !this.storage.get(node, "__typename")) {
60192
+ const nodeID = this.storage.get(node, "id");
60193
+ if (!nodeID) {
60192
60194
  continue;
60193
60195
  }
60194
- newNodeIDs.push(node);
60196
+ existingIDs.add(nodeID.value);
60195
60197
  }
60196
- oldIDs = oldIDs.filter((id) => {
60198
+ return insert.filter((id) => {
60197
60199
  if (!id) {
60198
60200
  return true;
60199
60201
  }
60200
- const { value: value2 } = this.storage.get(id, "node");
60201
- const node = value2;
60202
- if (newNodeIDs.includes(node) && emptyEdges.includes(node)) {
60203
- return false;
60202
+ const { value: node } = this.storage.get(id, "node");
60203
+ if (!node) {
60204
+ return true;
60204
60205
  }
60205
- return true;
60206
+ const nodeID = this.storage.get(node, "id");
60207
+ if (!nodeID) {
60208
+ return true;
60209
+ }
60210
+ return !existingIDs.has(nodeID.value);
60206
60211
  });
60207
- }
60212
+ };
60208
60213
  for (const update of applyUpdates) {
60209
60214
  if (update !== "replace" && !updates.includes(update)) {
60210
60215
  continue;
60211
60216
  }
60212
60217
  if (update === "prepend") {
60213
- linkedIDs = newIDs.concat(oldIDs);
60218
+ linkedIDs = newIDs.concat(
60219
+ filterIDs(newIDs, oldIDs)
60220
+ );
60214
60221
  if (layer?.optimistic) {
60215
60222
  action = () => {
60216
60223
  for (const id of newIDs) {
@@ -60221,7 +60228,7 @@ var CacheInternal = class {
60221
60228
  };
60222
60229
  }
60223
60230
  } else if (update === "append") {
60224
- linkedIDs = oldIDs.concat(newIDs);
60231
+ linkedIDs = filterIDs(newIDs, oldIDs).concat(newIDs);
60225
60232
  if (layer?.optimistic) {
60226
60233
  action = () => {
60227
60234
  for (const id of newIDs) {
@@ -72568,20 +72568,21 @@ var CacheInternal = class {
72568
72568
  }
72569
72569
  } else if (Array.isArray(value) && (typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
72570
72570
  let oldIDs = [...previousValue || []];
72571
- const emptyEdges = !updates ? [] : oldIDs.map((id) => {
72572
- if (!id) {
72573
- return "";
72574
- }
72575
- const { value: cursorField } = this.storage.get(id, "cursor");
72576
- if (cursorField) {
72577
- return "";
72578
- }
72579
- const { value: node } = this.storage.get(id, "node");
72580
- if (!node) {
72581
- return "";
72582
- }
72583
- return node;
72584
- });
72571
+ if (updates?.includes("append") || updates?.includes("prepend")) {
72572
+ oldIDs = oldIDs.filter((id) => {
72573
+ for (const layer2 of this.storage.data) {
72574
+ for (const operation of Object.values(layer2.operations)) {
72575
+ if (operation.fields?.[key])
72576
+ for (const listOperation of operation.fields[key]) {
72577
+ if ("id" in listOperation && listOperation.id === id) {
72578
+ return false;
72579
+ }
72580
+ }
72581
+ }
72582
+ }
72583
+ return true;
72584
+ });
72585
+ }
72585
72586
  let linkedIDs = [];
72586
72587
  const { newIDs, nestedIDs } = this.extractNestedListIDs({
72587
72588
  value,
@@ -72600,39 +72601,45 @@ var CacheInternal = class {
72600
72601
  layer.writeLink(parent2, key, linkedIDs);
72601
72602
  };
72602
72603
  if (applyUpdates && updates) {
72603
- if (key === "edges") {
72604
- const newNodeIDs = [];
72605
- for (const id of newIDs) {
72604
+ const filterIDs = (keep, insert) => {
72605
+ const existingIDs = /* @__PURE__ */ new Set();
72606
+ for (const id of keep) {
72606
72607
  if (!id) {
72607
72608
  continue;
72608
72609
  }
72609
72610
  const { value: node } = this.storage.get(id, "node");
72610
- if (typeof node !== "string") {
72611
+ if (!node) {
72611
72612
  continue;
72612
72613
  }
72613
- if (!node || !this.storage.get(node, "__typename")) {
72614
+ const nodeID = this.storage.get(node, "id");
72615
+ if (!nodeID) {
72614
72616
  continue;
72615
72617
  }
72616
- newNodeIDs.push(node);
72618
+ existingIDs.add(nodeID.value);
72617
72619
  }
72618
- oldIDs = oldIDs.filter((id) => {
72620
+ return insert.filter((id) => {
72619
72621
  if (!id) {
72620
72622
  return true;
72621
72623
  }
72622
- const { value: value2 } = this.storage.get(id, "node");
72623
- const node = value2;
72624
- if (newNodeIDs.includes(node) && emptyEdges.includes(node)) {
72625
- return false;
72624
+ const { value: node } = this.storage.get(id, "node");
72625
+ if (!node) {
72626
+ return true;
72626
72627
  }
72627
- return true;
72628
+ const nodeID = this.storage.get(node, "id");
72629
+ if (!nodeID) {
72630
+ return true;
72631
+ }
72632
+ return !existingIDs.has(nodeID.value);
72628
72633
  });
72629
- }
72634
+ };
72630
72635
  for (const update of applyUpdates) {
72631
72636
  if (update !== "replace" && !updates.includes(update)) {
72632
72637
  continue;
72633
72638
  }
72634
72639
  if (update === "prepend") {
72635
- linkedIDs = newIDs.concat(oldIDs);
72640
+ linkedIDs = newIDs.concat(
72641
+ filterIDs(newIDs, oldIDs)
72642
+ );
72636
72643
  if (layer?.optimistic) {
72637
72644
  action = () => {
72638
72645
  for (const id of newIDs) {
@@ -72643,7 +72650,7 @@ var CacheInternal = class {
72643
72650
  };
72644
72651
  }
72645
72652
  } else if (update === "append") {
72646
- linkedIDs = oldIDs.concat(newIDs);
72653
+ linkedIDs = filterIDs(newIDs, oldIDs).concat(newIDs);
72647
72654
  if (layer?.optimistic) {
72648
72655
  action = () => {
72649
72656
  for (const id of newIDs) {