@vuu-ui/vuu-data-remote 0.13.42 → 0.13.44

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.
@@ -537,21 +537,34 @@ var createSchemaFromTableMetadata = ({
537
537
  key
538
538
  };
539
539
  };
540
- var gapBetweenLastRowSentToClient = (lastRowsReturnedToClient, pendingUpdates, clientRange) => {
540
+ var gapBetweenLastRowSentToClient = (lastRowsReturnedToClient, pendingUpdates, clientRange, rowCount) => {
541
541
  const firstPendingUpdate = pendingUpdates.at(0);
542
542
  const lastPendingUpdate = pendingUpdates.at(-1);
543
543
  if (firstPendingUpdate && lastPendingUpdate) {
544
+ const maxTo = Math.min(rowCount, clientRange.to);
544
545
  const [firstRowIndex, lastRowIndex] = lastRowsReturnedToClient;
545
546
  if (lastRowIndex < firstPendingUpdate.rowIndex - 1 && clientRange.from < firstPendingUpdate.rowIndex) {
546
547
  return {
547
548
  from: Math.max(lastRowIndex + 1, clientRange.from),
548
549
  to: firstPendingUpdate.rowIndex
549
550
  };
550
- } else if (firstRowIndex > lastPendingUpdate.rowIndex + 1 && clientRange.to > lastPendingUpdate.rowIndex) {
551
+ } else if (firstRowIndex > lastPendingUpdate.rowIndex + 1 && maxTo > lastPendingUpdate.rowIndex) {
551
552
  return {
552
553
  from: lastPendingUpdate.rowIndex + 1,
553
- to: Math.min(clientRange.to, firstRowIndex)
554
+ to: Math.min(maxTo, firstRowIndex)
554
555
  };
556
+ } else if (firstRowIndex === -1 && lastRowIndex === -1) {
557
+ if (clientRange.from < firstPendingUpdate.rowIndex) {
558
+ return {
559
+ from: clientRange.from,
560
+ to: firstPendingUpdate.rowIndex
561
+ };
562
+ } else if (maxTo > lastPendingUpdate.rowIndex + 1) {
563
+ return {
564
+ from: lastPendingUpdate.rowIndex + 1,
565
+ to: maxTo
566
+ };
567
+ }
555
568
  }
556
569
  }
557
570
  };
@@ -868,6 +881,10 @@ var Viewport = class {
868
881
  // Records SIZE only updates
869
882
  __publicField(this, "setLastSizeOnlyUpdateSize", (size) => {
870
883
  this.lastUpdateStatus.size = size;
884
+ if (size === 0) {
885
+ this.lastRowsReturnedToClient[0] = -1;
886
+ this.lastRowsReturnedToClient[1] = -1;
887
+ }
871
888
  });
872
889
  __publicField(this, "setLastUpdate", (mode) => {
873
890
  const { ts: lastTS, mode: lastMode } = this.lastUpdateStatus;
@@ -1409,7 +1426,8 @@ var Viewport = class {
1409
1426
  const missingRows = gapBetweenLastRowSentToClient(
1410
1427
  this.lastRowsReturnedToClient,
1411
1428
  this.pendingUpdates,
1412
- this.dataWindow.clientRange
1429
+ this.dataWindow.clientRange,
1430
+ this.dataWindow.rowCount
1413
1431
  );
1414
1432
  if (missingRows) {
1415
1433
  for (let i = missingRows.from; i < missingRows.to; i++) {
@@ -1433,6 +1451,9 @@ var Viewport = class {
1433
1451
  }
1434
1452
  this.lastRowsReturnedToClient[0] = (_b = (_a = out.at(0)) == null ? void 0 : _a[0]) != null ? _b : -1;
1435
1453
  this.lastRowsReturnedToClient[1] = (_d = (_c = out.at(-1)) == null ? void 0 : _c[0]) != null ? _d : -1;
1454
+ } else if (this.pendingUpdates.length > 0) {
1455
+ this.lastRowsReturnedToClient[0] = -1;
1456
+ this.lastRowsReturnedToClient[1] = -1;
1436
1457
  }
1437
1458
  this.pendingUpdates.length = 0;
1438
1459
  this.hasUpdates = false;
@@ -2066,7 +2087,7 @@ var ServerProxy = class {
2066
2087
  }
2067
2088
  }
2068
2089
  handleMessageFromServer(message) {
2069
- var _a, _b, _c;
2090
+ var _a;
2070
2091
  const { body, requestId, sessionId } = message;
2071
2092
  const pendingRequest = this.pendingRequests.get(requestId);
2072
2093
  if (pendingRequest) {
@@ -2172,7 +2193,7 @@ var ServerProxy = class {
2172
2193
  {
2173
2194
  const viewportRowMap = groupRowsByViewport(body.rows);
2174
2195
  if (debugEnabled3) {
2175
- const [firstRow, secondRow] = body.rows;
2196
+ const [firstRow] = body.rows;
2176
2197
  if (body.rows.length === 0) {
2177
2198
  infoEnabled2 && info2("handleMessageFromServer TABLE_ROW 0 rows");
2178
2199
  } else if ((firstRow == null ? void 0 : firstRow.rowIndex) === -1) {
@@ -2181,9 +2202,6 @@ var ServerProxy = class {
2181
2202
  infoEnabled2 && info2(
2182
2203
  \`handleMessageFromServer [\${firstRow.viewPortId}] TABLE_ROW SIZE ONLY \${firstRow.vpSize}\`
2183
2204
  );
2184
- infoEnabled2 && info2(
2185
- \`handleMessageFromServer [\${firstRow.viewPortId}] TABLE_ROW SIZE ONLY \${firstRow.vpSize}\`
2186
- );
2187
2205
  } else {
2188
2206
  infoEnabled2 && info2(
2189
2207
  \`handleMessageFromServer [\${firstRow.viewPortId}] TABLE_ROW SIZE \${firstRow.vpSize} rowIdx \${firstRow.rowIndex}\`
@@ -2191,12 +2209,12 @@ var ServerProxy = class {
2191
2209
  }
2192
2210
  } else {
2193
2211
  infoEnabled2 && info2(
2194
- \`handleMessageFromServer TABLE_ROW \${body.rows.length} rows, SIZE \${firstRow.vpSize}, [\${secondRow == null ? void 0 : secondRow.rowIndex}] - [\${(_b = body.rows[body.rows.length - 1]) == null ? void 0 : _b.rowIndex}]\`
2212
+ \`handleMessageFromServer TABLE_ROW \${body.rows.length} rows, SIZE \${firstRow.vpSize}, [\${body.rows.map((r) => r.rowIndex).join(",")}]\`
2195
2213
  );
2196
2214
  }
2197
2215
  } else {
2198
2216
  infoEnabled2 && info2(
2199
- \`handleMessageFromServer TABLE_ROW \${body.rows.length} rows [\${firstRow == null ? void 0 : firstRow.rowIndex}] - [\${(_c = body.rows[body.rows.length - 1]) == null ? void 0 : _c.rowIndex}]\`
2217
+ \`handleMessageFromServer TABLE_ROW \${body.rows.length} rows [\${body.rows.map((r) => r.rowIndex).join(",")}]\`
2200
2218
  );
2201
2219
  }
2202
2220
  }