Repository navigation
feat: show a pending message while a scrape job polls - #35
Open
nahuel007ng wants to merge 1 commit into
Open
nahuel007ng wants to merge 1 commit into
nahuel007ng wants to merge 1 commit into
Conversation
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.
Closes #4
Summary
getScrapedinfrontend/src/services/api.jstakes an optional{ onPending }, called with{ state: 'pending' }on a 202 and with each non-terminal polled job state (for examplerunning).searchMedicinesandcompareMedicinepass it through via an optional options argument. The 202 -> poll -> replay flow, timeouts and error paths are unchanged.SearchMedicinePage.jsxandMedicineComparisonPage.jsxshow "Fetching live prices... this can take up to ~40s" with the job state while polling, and clear it on success, error, unmount or a new request.UploadPrescriptionPage.jsxis left out on purpose to keep this PR to the two pages in the issue.Test plan
cd frontend && npm run lint && npm run build(Node 20 as in CI, and Node 22)Notes
searchMedicinesandcompareMedicinekeep working without the new argument.