Commit fd1008a
committed
fix(check-links): one external request per URL, not per occurrence
Third defect in `--external`, and the one that explains why nobody ever ran it:
the fetch sat unmemoised inside the per-page link loop, so every external URL was
re-checked once for each page linking it. `https://github.com/imqueue` appears on
effectively all 1,898 crawled pages — at ~500ms each that is 15 minutes for a single
URL. Because the report buffers to the end, it presented as a hang rather than as
arithmetic: measured twice at 20+ minutes with zero bytes written, killed by hand
both times.
Memoised by URL, plus per-URL progress on stderr so it can never look hung again.
75 unique external links, 1m13s end to end.
Also: localhost is never a link, it is an EXAMPLE. The tutorial tells readers to open
http://localhost:3000/ and :8888/, and --external was connecting to whatever machine
ran the check and reporting ECONNREFUSED as link rot across five pages. Six of the
twelve failures on the first working run were that — precisely the noise that gets a
weekly job muted in a fortnight. Now classified as ignore, next to mailto: and tel:.
The remaining three failures were real responses that need judgement rather than
repair, so they are in the allowlist with their reasons and the date they were
verified: mcp.imqueue.org/mcp 405s because it is POST-only by design (Track B's B6
proposes making that stricter), vscode.dev's MCP install redirect 400s without its
query parameters, and privacy.microsoft.com — cited from both privacy policies as
Clarity's data-processing statement — refuses an unattended HEAD while loading fine
in a browser.
`npm run check:links:external` now exits 0: 75 external links checked, none broken.
That is the first completed run of this check in the repo's history, so it is also
the first evidence that there is no external link rot — the earlier claim of "no rot
today" could not have come from a working checker.1 parent 4b31283 commit fd1008a
3 files changed
Lines changed: 58 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
292 | 300 | | |
293 | 301 | | |
294 | 302 | | |
| |||
329 | 337 | | |
330 | 338 | | |
331 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
332 | 368 | | |
333 | 369 | | |
334 | 370 | | |
| |||
403 | 439 | | |
404 | 440 | | |
405 | 441 | | |
406 | | - | |
407 | | - | |
408 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
409 | 445 | | |
410 | 446 | | |
411 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments