Fix browser transaction scan progress#53
Merged
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.
Summary
Original request
What changed
GET /api/transaction-scans/jobs/statuscontract/API endpoint that returns the latest scan job progress event for a short-lived job token./app-api/transaction-scans/jobs/statusthat forwards browser polling requests to the internal API.Reasoning
The scan job was created successfully, but the browser then tried to consume
transactionScans.progress()through the public/apiNext proxy. Cleverbrush subscriptions use WebSockets, and the Next route proxy handles normal HTTP but not WebSocket upgrades. When the socket closes without a terminal scan event, the UI reportsCould not connect to scan progress. Try again.Polling a small latest-status endpoint keeps the browser flow on same-origin HTTP while preserving the existing subscription API for clients that connect directly to the API service.Validation
npm run lintnpm run typechecknpm testLint and testDeploy PR environmentPlaywright e2ehttps://xpenser-pr-053.cleverbrush.comxpenser-web-pr-53orxpenser-api-pr-53after deploy and preview QA. Queries against those resource filters returned zero scanned rows.Screenshots / Preview
Preview QA exercised the image scan flow with a synthetic PNG. The UI reached
Reading visible text and totals.progress, then returned the scanner's normalCould not scan the image. Try again.result for the low-information test image. It did not showCould not connect to scan progress. Try again.Checklist