{{ message }}
fix(js-sdk): correctly handle interact timeout units#3425
Open
EaCognitive wants to merge 1 commit intofirecrawl:mainfrom
Open
fix(js-sdk): correctly handle interact timeout units#3425EaCognitive wants to merge 1 commit intofirecrawl:mainfrom
EaCognitive wants to merge 1 commit intofirecrawl:mainfrom
Conversation
The /interact endpoint expects the timeout in seconds, whereas other endpoints expect milliseconds. This fixes a bug where the Axios timeout for interact requests was set to 5000 + the timeout value in seconds, leading to premature timeouts.
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.

Fixes #3407
Description
The
interact()method in the JavaScript SDK expects thetimeoutparameter to be expressed in seconds (up to 300) per the Firecrawl API. However, the Axios request interceptor was treating this value as milliseconds and adding 5000 to it (e.g.,300 + 5000 = 5300ms). This caused interactions to prematurely timeout locally after ~5.3 seconds.This PR fixes the issue by intercepting requests explicitly routed to the
/interactendpoint and converting the suppliedtimeoutvalue from seconds to milliseconds before applying it to the Axios configuration.Summary by cubic
Fixes premature timeouts in the JS SDK by converting
interact()timeouts from seconds to milliseconds in theaxiosrequest interceptor, aligning with the Firecrawl API and preventing ~5.3s local timeouts./interact, multiplydata.timeoutby 1000; other endpoints still use milliseconds.Written for commit 81c830d. Summary will update on new commits.