@crawlee/core 4.0.0-beta.240 → 4.0.0-beta.241

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.
@@ -55,7 +55,10 @@ export class DatasetBackend extends BaseClient {
55
55
  }
56
56
  async #getDataPage(options = {}) {
57
57
  const { limit = LIST_ITEMS_LIMIT, offset = 0, desc } = options;
58
- const [start, end] = this.#getStartAndEndIndexes(desc ? Math.max(this.itemCount - offset - limit, 0) : offset, limit);
58
+ // In descending order, the window ends `offset` items before the newest one, so it can be shorter than `limit`.
59
+ const windowStart = desc ? Math.max(this.itemCount - offset - limit, 0) : offset;
60
+ const windowEnd = desc ? Math.max(this.itemCount - offset, 0) : offset + limit;
61
+ const [start, end] = this.#getStartAndEndIndexes(windowStart, windowEnd - windowStart);
59
62
  const items = [];
60
63
  for (let idx = start; idx < end; idx++) {
61
64
  const entryNumber = this.#generateLocalEntryName(idx);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/core",
3
- "version": "4.0.0-beta.240",
3
+ "version": "4.0.0-beta.241",
4
4
  "description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
5
5
  "engines": {
6
6
  "node": ">=22.13.0"
@@ -53,10 +53,10 @@
53
53
  "@apify/log": "^3.0.1",
54
54
  "@apify/timeout": "^1.0.1",
55
55
  "@apify/utilities": "^3.0.1",
56
- "@crawlee/fs-storage": "4.0.0-beta.240",
57
- "@crawlee/http-client": "4.0.0-beta.240",
58
- "@crawlee/types": "4.0.0-beta.240",
59
- "@crawlee/utils": "4.0.0-beta.240",
56
+ "@crawlee/fs-storage": "4.0.0-beta.241",
57
+ "@crawlee/http-client": "4.0.0-beta.241",
58
+ "@crawlee/types": "4.0.0-beta.241",
59
+ "@crawlee/utils": "4.0.0-beta.241",
60
60
  "@sapphire/async-queue": "^1.5.5",
61
61
  "@standard-schema/spec": "^1.0.0",
62
62
  "@vladfrangu/async_event_emitter": "^2.4.6",
@@ -76,5 +76,5 @@
76
76
  }
77
77
  }
78
78
  },
79
- "gitHead": "040d91e9f36dfd4c99f73b63abd97b92b82d89a4"
79
+ "gitHead": "1c337d1ef50c3e28e25e2ae40bc38bb6de67c37e"
80
80
  }