Skip to content

feat(media): move reindex to Settings, and unblock uploads at Nginx - #121

Merged
ssavutu merged 1 commit into
mainfrom
media/reindex-in-settings
Jul 31, 2026
Merged

feat(media): move reindex to Settings, and unblock uploads at Nginx#121
ssavutu merged 1 commit into
mainfrom
media/reindex-in-settings

Conversation

@ssavutu

@ssavutu ssavutu commented Jul 31, 2026

Copy link
Copy Markdown
Member

Reindex moves to Settings

It is a maintenance action, not a browsing action, so it now sits alongside Taxonomy in Settings instead of in the Media page header.

Two behaviours the old button did not have:

  • Resumes on mount. A GET /v1/media/index on load joins an index already running — started before the page was opened, or by another admin — rather than showing an idle button while work is in flight.
  • Single poll loop. A mediaPollActive ref stops the mount-resume and a click from both polling and fighting over the status message.

409 is still treated as "join the running one", not an error. The empty-state hint on the Media page now points at Settings.

Uploads were failing with 413

Nginx's stock client_max_body_size is 1m. The backend allows 25 MiB (MEDIA_MAX_UPLOAD_BYTES), but Nginx rejected anything larger than 1 MB before the request ever reached it — so any ordinary phone photo failed, with the app looking correctly configured.

/v1/ now sets client_max_body_size 26m, just above the backend limit, so the backend stays the component that decides. deploy/README.md records that the two must be raised together.

This one needs a deploy action: the site file has to be re-copied to Delta and Nginx reloaded. Merging alone does not fix the 413.

Checks

tsc --noEmit, eslint, and npm run build clean.

🤖 Generated with Claude Code

Reindex is a maintenance action, not a browsing action, so it belongs
with the other maintenance controls in Settings rather than in the
Media page header. The Settings card also picks up an index already
running -- started before the page was opened, or by another admin --
instead of showing an idle button while work is in flight, and a ref
guard keeps the mount-resume and a click from both polling.

Also raise client_max_body_size to 26m on /v1/. Nginx's stock limit is
1m, so any ordinary phone photo was rejected with a 413 before the
request reached the CMS, and the backend's own 25 MiB
MEDIA_MAX_UPLOAD_BYTES never got a say.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ssavutu
ssavutu merged commit 6ef2121 into main Jul 31, 2026
6 checks passed
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