@crawlee/core 4.0.0-beta.265 → 4.0.0-beta.267

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/core",
3
- "version": "4.0.0-beta.265",
3
+ "version": "4.0.0-beta.267",
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.1.0",
56
- "@crawlee/fs-storage": "4.0.0-beta.265",
57
- "@crawlee/http-client": "4.0.0-beta.265",
58
- "@crawlee/types": "4.0.0-beta.265",
59
- "@crawlee/utils": "4.0.0-beta.265",
56
+ "@crawlee/fs-storage": "4.0.0-beta.267",
57
+ "@crawlee/http-client": "4.0.0-beta.267",
58
+ "@crawlee/types": "4.0.0-beta.267",
59
+ "@crawlee/utils": "4.0.0-beta.267",
60
60
  "@sapphire/async-queue": "^1.5.5",
61
61
  "@standard-schema/spec": "^1.1.0",
62
62
  "@vladfrangu/async_event_emitter": "^2.4.7",
@@ -76,5 +76,5 @@
76
76
  }
77
77
  }
78
78
  },
79
- "gitHead": "fa0976bd3977fcc23a2162de18ad0065d66586f1"
79
+ "gitHead": "a4e49e8a8117acdb808c6cba5b05c3d56bf2b123"
80
80
  }
@@ -32,7 +32,7 @@ export type RequestLoaderStatus = Exclude<RequestSourceStatus, {
32
32
  status: 'stalled';
33
33
  }>;
34
34
  /**
35
- * Combines two request sources' statuses, with the precedence `ready` > `stalled` > `waiting` > `finished`.
35
+ * Combines two request sources' statuses, with the precedence `ready` > `waiting` > `stalled` > `finished`.
36
36
  *
37
37
  * Binary rather than variadic on purpose: it is on the task loop's probe path and folding a pair allocates
38
38
  * nothing.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Combines two request sources' statuses, with the precedence `ready` > `stalled` > `waiting` > `finished`.
2
+ * Combines two request sources' statuses, with the precedence `ready` > `waiting` > `stalled` > `finished`.
3
3
  *
4
4
  * Binary rather than variadic on purpose: it is on the task loop's probe path and folding a pair allocates
5
5
  * nothing.
@@ -13,17 +13,9 @@ export function joinRequestSourceStatuses(a, b) {
13
13
  if (b.status === 'ready') {
14
14
  return b;
15
15
  }
16
- // `ready` outranking `stalled` masks a stalled source while the other still has work. That is parity with
17
- // the crawler before this was a single answer: the stall check was only reached from `isFinishedFunction`,
18
- // which the task loop calls only when nothing is in flight and nothing is ready. "Fixing" the masking
19
- // turns a crawl that is progressing elsewhere into a `PersistentRateLimitError`. `stalled` outranking
20
- // `waiting` is the same parity - that call site fired regardless of other domains' clocks.
21
- if (a.status === 'stalled') {
22
- return a;
23
- }
24
- if (b.status === 'stalled') {
25
- return b;
26
- }
16
+ // `ready` and `waiting` outranking `stalled` mask a stalled source while the other still has work, now or
17
+ // later. The crawler turns `stalled` into a `PersistentRateLimitError`, so "fixing" the masking turns a crawl
18
+ // that can still progress elsewhere into a failure. The stall surfaces once the other source runs out of work.
27
19
  if (a.status === 'waiting') {
28
20
  // The earlier of the two known wake-up times - unknown only if neither source announced one.
29
21
  if (b.status !== 'waiting' || b.readyAt === undefined) {
@@ -31,6 +23,12 @@ export function joinRequestSourceStatuses(a, b) {
31
23
  }
32
24
  return a.readyAt !== undefined && a.readyAt <= b.readyAt ? a : b;
33
25
  }
26
+ if (b.status === 'waiting') {
27
+ return b;
28
+ }
29
+ if (a.status === 'stalled') {
30
+ return a;
31
+ }
34
32
  // `a` is finished, so `b` decides.
35
33
  return b;
36
34
  }