feat: resolve redirects before mapping urls#2439
Merged
amplitudesxd merged 3 commits intomainfrom Nov 25, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
2 issues found across 3 files
Prompt for AI agents (all 2 issues)
Understand the root cause of the following 2 issues and fix them.
<file name="apps/api/src/__tests__/snips/v2/map.test.ts">
<violation number="1" location="apps/api/src/__tests__/snips/v2/map.test.ts:128">
Wrap this redirect test in concurrentIf(ALLOW_TEST_SUITE_WEBSITE) (or use a mock) so it doesn’t make real network calls when external access is disabled.</violation>
</file>
<file name="apps/api/src/lib/validateUrl.ts">
<violation number="1" location="apps/api/src/lib/validateUrl.ts:213">
Propagate AbortError instead of swallowing it so cancellation via the provided AbortSignal actually rejects the promise.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
Member
Author
|
@cubic-dev-ai re-review |
Contributor
@amplitudesxd I've started the AI code review. It'll take a few minutes to complete. |
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="apps/api/src/lib/validateUrl.ts">
<violation number="1" location="apps/api/src/lib/validateUrl.ts:213">
Abort signal is swallowed in resolveRedirects, so canceled map jobs keep running instead of stopping when the abort signal fires.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
Member
Author
|
Contributor
@amplitudesxd I've started the AI code review. It'll take a few minutes to complete. |
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="apps/api/src/lib/validateUrl.ts">
<violation number="1" location="apps/api/src/lib/validateUrl.ts:212">
HEAD responses are returned without checking for 405/501, so servers that disallow HEAD never hit the GET fallback and their redirects still are not resolved.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
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 by cubic
Resolve and follow URL redirects before running map so sites like firecrawl.com (redirects to firecrawl.dev) are mapped correctly. Fixes ENG-4022 where map failed on redirected domains.
Written for commit b825250. Summary will update automatically on new commits.