Repository navigation
fix(save-link,@packages/crawl-article,@packages/finalize-article): never fetch or keep proven tracking pixels as article images - #1337
Conversation
|
@claude Review this PR. Use your Read tool to read the local file Context
|
|
Claude finished @FagnerMartinsBrack's task in 38s —— View job I'll analyze this and get back to you. |
High Priority Issues (Must Fix)None found Medium Priority IssuesNone found Low Priority Suggestions1. Every finalised article now gets one more full DOM parse
2. A
|
|
@claude address al low prio issues |
|
Claude finished @FagnerMartinsBrack's task in 3m 38s —— View job Low-priority review itemsI fixed item 2, made a smaller fix than suggested for item 1, and item 3 needed no change. All of it is in commit
1. Extra parse — only partly addressed. I did not use the suggested hostname substring check. The PR's own tests treat Instead, 2. 3. Failure reason — no change needed. The reason is stored as |
|
@claude Review this PR. Use your Read tool to read the local file Context
|
|
Claude finished @FagnerMartinsBrack's task in 42s —— View job I'll analyze this and get back to you. |
High Priority Issues (Must Fix)None found Medium Priority IssuesNone found Low Priority Suggestions1. The
|
|
@claude Resolve conflicts. Use your Read tool to read the local file Context
|
|
Claude finished @FagnerMartinsBrack's task in 18m 14s —— View job Conflicts with
|
…ver fetch or keep proven tracking pixels as article images In the week to 2026-11-07, 67 of the 280 unusable-image errors in the fleet errors widget were tracking endpoints the thumbnail cascade fetched as images: Facebook's /tr pixel, Hotstar's page-view tracker, and the Akamai /akam/13/pixel_ beacon on www.sec.gov and www.turkishairlines.com. One shared predicate in crawl-article matches only those four origins and paths, by exact parsed hostname and pathname. Thumbnail discovery drops them before the cascade, a supplied candidate list or resolved thumbnail cannot bring one back, and an image-only capture of a beacon ends as a handled failure instead of saving the beacon as the image. Body-image downloads skip them without spending one of the article's image slots, and newly processed HTML loses their src and srcset entries so the reader's browser never requests them either. Logos, QR codes, SVGs and other unusable images are untouched; stored articles are not rewritten.
…g tracking sources When a picture's fallback img lost its only src to a tracking pixel but a source still held an allowed rendition, the img was kept with no src, so a browser that skipped that source (a type or media condition) showed nothing. The img now takes the first remaining rendition as its src, which the CDN rewrite then maps like any other downloaded image. stripTrackingImageSources also returns a body with no img or source tag without parsing it. Co-authored-by: Fayner Brack <FagnerMartinsBrack@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ed thumbnail as before Drop the image-only failure for a beacon URL and the resolved-thumbnail filter. None of the 67 observed errors came from a direct save of a beacon URL; all were thumbnail-cascade fetches, which the cascade's own filter already stops. A reader's capture may fail only on the deterministic readability check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QeLuXYjTyQzYesHMBs3wxT
a7c40c1 to
f4d146e
Compare
Why
In the week to 2026-11-07 the fleet errors widget held 280 unusable-image errors, all from the thumbnail cascade. 67 of them (24%) were tracking endpoints fetched as if they were article images:
/tr/v1/events/track/cp_page_view/akam/13/pixel_+ 8 hex/akam/13/pixel_+ 8 hexEach one cost up to 5 s of the thumbnail cascade. It could also end up as the article's thumbnail, or stay in the saved HTML, where the reader's browser would request it.
What changed
isProvenTrackingImageUrlin@packages/crawl-articlematches only those four exact hostnames and paths, as the URL parser reads them. Query, fragment and default port don't affect a match. A lookalike host, a different path or a non-default port is not matched. The paths are not decoded a second time.img src,img srcsetandpicture source srcsetare never downloaded, and an image whose only sources are tracking URLs doesn't use one of the 20 image slots. Images with onlydata:or relative sources still count, as before.strip-tracking-image-sourcesruns even when nothing was downloaded. It removes only the matching src and srcset entries, keeps the descriptors of the entries that remain, never leaves an emptysrc, and returns the HTML unchanged when nothing matches. When a<picture>'s fallback<img>loses its onlysrcand a sibling<source>still has an allowed rendition, the<img>takes that rendition's URL.finalize-article.tsis unchanged frommain(commita7c40c1). An earlier commit on this PR also failed an image-only save whose only image was a beacon, and dropped a crawler-resolved thumbnail that was a beacon. No observed save motivated either: all 67 errors were thumbnail-cascade fetches. CLAUDE.md lets a reader's capture fail only on the deterministic readability check. Both guards were removed.Not changed: the other 213 unusable-image errors (logos, QR codes, SVGs, CIA photos). Those can't be safely classified from the URL alone, so this PR doesn't touch them, and it does not claim to clear all 280. Stored articles are not rewritten either.
Validation
pnpm checkpassed on each commit.After deploy
🤖 Generated with Claude Code
https://claude.ai/code/session_01QeLuXYjTyQzYesHMBs3wxT