@ai-matrx/records 0.87.16 → 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.
@@ -3617,7 +3617,12 @@ function createRecordsClient(given) {
3617
3617
  );
3618
3618
  let total = Number(answer?.total ?? 0);
3619
3619
  let locked = 0;
3620
- const plainPage = (!filter || Object.keys(filter).length === 0) && (!search || search.trim() === "") && (!sort || sort.length === 0) && view_id == null;
3620
+ const unfiltered = (!filter || Object.keys(filter).length === 0) && (!search || search.trim() === "") && view_id == null;
3621
+ const plainPage = unfiltered && (!sort || sort.length === 0);
3622
+ const lockedOffPage = Number(answer?.locked ?? 0);
3623
+ if (!plainPage && unfiltered && Number.isFinite(lockedOffPage) && lockedOffPage > 0) {
3624
+ locked = Math.max(lockedOnPage, lockedOffPage);
3625
+ }
3621
3626
  if (plainPage) {
3622
3627
  const counted = await client.recordAggregate({ table_id, measures: [{ op: "count" }] });
3623
3628
  if (!counted.ok) return err(counted.error);
@@ -3627,7 +3632,7 @@ function createRecordsClient(given) {
3627
3632
  }
3628
3633
  locked = openable <= total ? Math.max(lockedOnPage, total - openable) : lockedOnPage;
3629
3634
  total = openable;
3630
- } else if (lockedOnPage > 0) {
3635
+ } else if (lockedOnPage > 0 && locked === 0) {
3631
3636
  locked = lockedOnPage;
3632
3637
  total = Math.max(rows.length, total - lockedOnPage);
3633
3638
  }