Skip to content

[firecrawl-ui] Fix Extract: poll the async job for its result#90

Merged
obeone merged 1 commit into
mainfrom
fix/extract-async-polling
Jun 28, 2026
Merged

[firecrawl-ui] Fix Extract: poll the async job for its result#90
obeone merged 1 commit into
mainfrom
fix/extract-async-polling

Conversation

@obeone

@obeone obeone commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

Extract reported a generic "Extraction failed" on Firecrawl v2 instances. The cause is in the API adapter: POST /v2/extract answers asynchronously with just { success: true, id } and no status field, but the old polling guard only kept polling when status === 'processing'. With no status on the initial response, it returned the job stub immediately, the view saw no data, and surfaced the failure.

The fix makes waitForExtract poll GET /v2/extract/{id} whenever a job id is present and no inline data came back, stopping on a terminal status (completed, failed, cancelled) or after a bounded number of attempts so a stuck job cannot hang the UI. The endpoint stays /v2/extract on purpose: migrating to /v2/scrape with a json format would drop multi-URL and prompt-only extraction.

Test plan

  • npm ci then npm run build succeeds
  • npx prettier --check . and npx eslint . pass
  • Manual: open Extract, provide a URL plus a prompt or schema, submit, and confirm structured data renders instead of "Extraction failed". (UI click-test still pending: the local browser driver cannot settle on the animated aurora background, so this last step needs a human pass.)

The v2 POST /extract response only carries { success, id } with no status
field, so the previous polling guard (status === 'processing') returned the
job stub immediately and the view reported a generic 'Extraction failed'.

Poll GET /extract/{id} whenever a job id is present and no inline data was
returned, stopping on a terminal status (completed, failed, cancelled) or
after a bounded number of attempts so a stuck job cannot hang the UI.
@obeone
obeone merged commit 0c8b3c8 into main Jun 28, 2026
2 checks passed
@obeone
obeone deleted the fix/extract-async-polling branch June 28, 2026 19:19
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.

1 participant