Repository navigation
Route review-page <img> through API base path - #123
Merged
Merged
Conversation
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
approved these changes
Apr 28, 2026
gekiclaws
left a comment
Contributor
There was a problem hiding this comment.
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.
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
The OCR review page hardcoded
<img src="/api/ocr/queue/.../image">. In production the site is served athub.avenuworkspaces.com/mail/...andnginx-rponly 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 upVITE_API_BASE_URL(/mail/apiin 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
/mail/admin/recording, confirm the image renders, DevTools showsGET /mail/api/ocr/queue/<id>/imagereturning 200.