@ai-matrx/records 0.87.17 → 0.87.19

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.
@@ -3480,7 +3480,12 @@ function createRecordsClient(given) {
3480
3480
  );
3481
3481
  let total = Number(answer?.total ?? 0);
3482
3482
  let locked = 0;
3483
- const plainPage = (!filter || Object.keys(filter).length === 0) && (!search || search.trim() === "") && (!sort || sort.length === 0) && view_id == null;
3483
+ const unfiltered = (!filter || Object.keys(filter).length === 0) && (!search || search.trim() === "") && view_id == null;
3484
+ const plainPage = unfiltered && (!sort || sort.length === 0);
3485
+ const lockedOffPage = Number(answer?.locked ?? 0);
3486
+ if (!plainPage && unfiltered && Number.isFinite(lockedOffPage) && lockedOffPage > 0) {
3487
+ locked = Math.max(lockedOnPage, lockedOffPage);
3488
+ }
3484
3489
  if (plainPage) {
3485
3490
  const counted = await client.recordAggregate({ table_id, measures: [{ op: "count" }] });
3486
3491
  if (!counted.ok) return err(counted.error);
@@ -3490,7 +3495,7 @@ function createRecordsClient(given) {
3490
3495
  }
3491
3496
  locked = openable <= total ? Math.max(lockedOnPage, total - openable) : lockedOnPage;
3492
3497
  total = openable;
3493
- } else if (lockedOnPage > 0) {
3498
+ } else if (lockedOnPage > 0 && locked === 0) {
3494
3499
  locked = lockedOnPage;
3495
3500
  total = Math.max(rows.length, total - lockedOnPage);
3496
3501
  }