Skip to content

fix(feedback): improve ESOURCE link parsing#806

Merged
thostetler merged 1 commit intoadsabs:masterfrom
thostetler:fix/esource-link-parsing
Feb 18, 2026
Merged

fix(feedback): improve ESOURCE link parsing#806
thostetler merged 1 commit intoadsabs:masterfrom
thostetler:fix/esource-link-parsing

Conversation

@thostetler
Copy link
Member

@thostetler thostetler commented Feb 17, 2026

The feedback page's URL list (via useGetResourceLinks) was scraping
footer links from the link_gateway ESOURCE page on 404 responses, and
the redirect detection was non-functional.

  • Add res.ok guard to return empty on non-2xx responses (404 was leaking footer links into the URL list)
  • Replace dead res.status === 302 check with res.redirected detection (browser fetch auto-follows redirects, so the old check never fired)
  • Replace page-wide href regex with DOMParser scoped to .list-group-item a elements
  • Remove brittle SKIP_URLS blocklist and URL_REGX regex (no longer needed with scoped parsing)

For testing: https://scixplorer.org/abs/1986JAVSO..15..282W/abstract

@thostetler thostetler marked this pull request as ready for review February 17, 2026 22:07
- Return empty on non-2xx responses (404 was leaking footer links)
- Detect redirects via res.redirected instead of dead res.status === 302
- Use DOMParser to scope parsing to .list-group-item links only
- Remove brittle SKIP_URLS blocklist and page-wide href regex
@thostetler thostetler force-pushed the fix/esource-link-parsing branch from 39e8cfe to 0239af2 Compare February 17, 2026 22:07
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 86.95652% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.9%. Comparing base (d131c2d) to head (0239af2).

Files with missing lines Patch % Lines
src/lib/useGetResourceLinks.ts 87.0% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #806     +/-   ##
========================================
- Coverage    62.0%   61.9%   -0.0%     
========================================
  Files         315     315             
  Lines       36392   36391      -1     
  Branches     1631    1632      +1     
========================================
- Hits        22537   22526     -11     
- Misses      13818   13828     +10     
  Partials       37      37             
Files with missing lines Coverage Δ
src/lib/useGetResourceLinks.ts 92.2% <87.0%> (-2.3%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@thostetler thostetler merged commit 206b978 into adsabs:master Feb 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants