Skip to content

Route review-page <img> through API base path - #123

Merged
gekiclaws merged 1 commit into
mainfrom
fix/ocr-queue-image-url
Apr 28, 2026
Merged

gekiclaws merged 1 commit into
mainfrom
fix/ocr-queue-image-url

Conversation

@thejonathangu

Copy link
Copy Markdown
Collaborator

Summary

The OCR review page hardcoded <img src="/api/ocr/queue/.../image">. In production the site is served at hub.avenuworkspaces.com/mail/... and nginx-rp only forwards /mail/* to the avenu-mail stack, so the hardcoded /api/... request went to whatever app owns the root and returned its 404 page (Next.js in our case), never reaching the Flask backend.

Switch to buildUrl() so the path picks up VITE_API_BASE_URL (/mail/api in both dev and prod), matching every other API call in the codebase.

This bug pre-dates the volume-backed image staging work; the staging volume itself is fine and is also needed for the fix to actually surface anything.

Test plan

  • CI green.
  • After merge + redeploy: upload a fresh OCR job in /mail/admin/recording, confirm the image renders, DevTools shows GET /mail/api/ocr/queue/<id>/image returning 200.

The OCR review page hardcoded `/api/ocr/queue/.../image` for the mail
photo `<img src>`. In production the site is served at
`hub.avenuworkspaces.com/mail/...` and `nginx-rp` only forwards
`/mail/*` to the avenu-mail stack — so the hardcoded `/api/...` request
went to whatever app owns the root and returned its 404 page (Next.js
in our case), never reaching the Flask backend.

Switch to `buildUrl()` so the path picks up `VITE_API_BASE_URL`
(`/mail/api` in both dev and prod), matching every other API call in
the codebase.

This bug pre-dates the volume-backed image staging work; the staging
volume itself is fine.

Made-with: Cursor
@gekiclaws gekiclaws added bug Something isn't working enhancement New feature or request labels Apr 28, 2026
@gekiclaws gekiclaws added this to the v1.0 milestone Apr 28, 2026
@gekiclaws
gekiclaws self-requested a review April 28, 2026 15:44

@gekiclaws gekiclaws left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

This is a nice targeted fix. Routing the image URL through buildUrl() is consistent with the rest of the frontend API calls and should correctly respect VITE_API_BASE_URL, which matters for the /mail/api production prefix.

Only thing I’d keep in the test plan is the post-deploy verification already listed: upload a fresh OCR job and confirm the image request goes to /mail/api/ocr/queue/<id>/image and returns 200.

No blockers from me.

@gekiclaws gekiclaws changed the title fix(ocr-queue): route review-page <img> through API base path Route review-page <img> through API base path Apr 28, 2026
@gekiclaws
gekiclaws merged commit 7bd0f7b into main Apr 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants