Skip to content

Fix browser transaction scan progress#53

Merged
andrewzolotukhin merged 1 commit into
mainfrom
fix/transaction-scan-progress-connection
Jun 24, 2026
Merged

Fix browser transaction scan progress#53
andrewzolotukhin merged 1 commit into
mainfrom
fix/transaction-scan-progress-connection

Conversation

@andrewzolotukhin

@andrewzolotukhin andrewzolotukhin commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Original request

use $pr-workflow to identify and fix why image scan stopped to work, it writes: Could not connect to scan progress. Try again.

What changed

  • Added a public GET /api/transaction-scans/jobs/status contract/API endpoint that returns the latest scan job progress event for a short-lived job token.
  • Added a same-origin web route at /app-api/transaction-scans/jobs/status that forwards browser polling requests to the internal API.
  • Updated the browser image scan flow to poll status over HTTP instead of opening the Cleverbrush WebSocket subscription through the Next proxy.
  • Kept the existing WebSocket progress subscription intact for direct API clients and the Telegram bot.
  • Added coverage for scan job status behavior, the web status route, contract auth metadata, and the browser scan polling path.

Reasoning

The scan job was created successfully, but the browser then tried to consume transactionScans.progress() through the public /api Next 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 reports Could 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 lint
  • npm run typecheck
  • npm test
  • GitHub check: Lint and test
  • GitHub check: Deploy PR environment
  • GitHub check: Playwright e2e
  • Preview QA on https://xpenser-pr-053.cleverbrush.com
  • SigNoz verification blocked: no trace/log service values found for xpenser-web-pr-53 or xpenser-api-pr-53 after 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 normal Could not scan the image. Try again. result for the low-information test image. It did not show Could not connect to scan progress. Try again.

Checklist

  • I kept the change focused.
  • I updated docs or tests where needed.
  • I checked for secrets, local env files, and generated build output.
  • API changes keep contracts, endpoint metadata, and handlers aligned.

@andrewzolotukhin andrewzolotukhin temporarily deployed to pr-53 June 24, 2026 18:45 — with GitHub Actions Inactive
@andrewzolotukhin andrewzolotukhin merged commit 4acbe17 into main Jun 24, 2026
4 checks passed
@andrewzolotukhin andrewzolotukhin deleted the fix/transaction-scan-progress-connection branch June 24, 2026 20:15
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