@ai-matrx/records 0.87.17 → 0.87.18

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.
@@ -3680,7 +3680,12 @@ function createRecordsClient(given) {
3680
3680
  );
3681
3681
  let total = Number(answer?.total ?? 0);
3682
3682
  let locked = 0;
3683
- const plainPage = (!filter || Object.keys(filter).length === 0) && (!search || search.trim() === "") && (!sort || sort.length === 0) && view_id == null;
3683
+ const unfiltered = (!filter || Object.keys(filter).length === 0) && (!search || search.trim() === "") && view_id == null;
3684
+ const plainPage = unfiltered && (!sort || sort.length === 0);
3685
+ const lockedOffPage = Number(answer?.locked ?? 0);
3686
+ if (!plainPage && unfiltered && Number.isFinite(lockedOffPage) && lockedOffPage > 0) {
3687
+ locked = Math.max(lockedOnPage, lockedOffPage);
3688
+ }
3684
3689
  if (plainPage) {
3685
3690
  const counted = await client.recordAggregate({ table_id, measures: [{ op: "count" }] });
3686
3691
  if (!counted.ok) return err(counted.error);
@@ -3690,7 +3695,7 @@ function createRecordsClient(given) {
3690
3695
  }
3691
3696
  locked = openable <= total ? Math.max(lockedOnPage, total - openable) : lockedOnPage;
3692
3697
  total = openable;
3693
- } else if (lockedOnPage > 0) {
3698
+ } else if (lockedOnPage > 0 && locked === 0) {
3694
3699
  locked = lockedOnPage;
3695
3700
  total = Math.max(rows.length, total - lockedOnPage);
3696
3701
  }