Add direct fetch fallback for URL loading with race condition#300
Merged
Merged
Conversation
…ding Fire both requests in parallel when loading a URL. Prefer the Jina Reader result; if Jina fails (HTTP error or network), quietly fall back to the direct fetch in case the site serves open CORS headers. If both fail, show the original Jina error. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014q3Z2gAqr6XZxMkQBTaoem
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Deploying tools with
|
| Latest commit: |
7b3bcf9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e5a8635d.tools-b1q.pages.dev |
| Branch Preview URL: | https://claude-cliche-highlighter-pa.tools-b1q.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhanced the URL loading mechanism to implement a race condition between Jina Reader proxy and direct fetch, allowing the page to load content even if Jina fails but the target site has open CORS headers.
Key Changes
fetchText()helper function that handles HTTP error checkingPromiserace semantics) but silently catches errors to avoid noiseImplementation Details
.catch(() => {})) to prevent unhandled rejection warningshttps://claude.ai/code/session_014q3Z2gAqr6XZxMkQBTaoem