Skip to content

fix: upload timeout UX, rate limit, specimen warning, deploy pipeline & struts config#37

Open
Gladrin22 wants to merge 3 commits intomasterfrom
fix/email-fixes-upload-timeout-rate-limit
Open

fix: upload timeout UX, rate limit, specimen warning, deploy pipeline & struts config#37
Gladrin22 wants to merge 3 commits intomasterfrom
fix/email-fixes-upload-timeout-rate-limit

Conversation

@Gladrin22
Copy link
Copy Markdown
Collaborator

What & Why

This PR fixes 7 issues reported by Brian Fisher covering upload reliability, deploy automation, and a critical Struts startup bug.


Fixes

1. Upload page — Cloudflare 524 timeout UX
Cloudflare cuts the browser connection after 100s but Tomcat keeps processing in the background — data is never lost. Users had no feedback and saw a confusing go back to homepage message.

  • Added a loading spinner overlay when upload is submitted
  • Auto-redirects to the Upload Report after 85s (before Cloudflare fires)
  • Message now correctly says check your Upload Report instead of go back to homepage

2. Rate limiter exemption for uploads
The Caddy rate limiter (10 req/min per IP) was blocking upload retries after a timeout. /upload.do is now fully exempt from rate limiting.

3. Specimen code space warning
Spaces were silently stripped from specimen codes with no feedback to curators. Upload Report now shows a warning: Spaces removed from specimen code (auto-corrected — please fix your source data)

4. Deploy pipeline fix

  • Added -T flag so docker compose exec works in GitHub Actions (non-TTY environment — was silently failing)
  • Added Docker Compose v1/v2 fallback (docker compose || docker-compose)
  • Switched git pull --no-edit to git pull --rebase to avoid stray merge commits on the production server

5. Tomcat port conflict
Port 8080 was occupied by another Java process on the host. Changed mapping to 8081:8080.

6. Struts config symlink fix
On Windows, struts-configDb.xml was checked out as a 22-byte placeholder file instead of real XML. This caused Struts ActionServlet to fail on startup — making every .do route return 404. Restored the correct XML.

7. Specimen warning implementation
MessageMgr.java defines the specimenIdSpacesRemoved constant and SpecimenUploadParse.java triggers it during upload parsing when spaces are detected in specimen codes.

Gladrin Gideon Aroul and others added 3 commits March 18, 2026 02:44
…data validation

The missing `ant deploy` step in GitHub Actions was causing JSP and web file
changes to be pushed to GitHub but never reflected on the live site. Tomcat
serves from /usr/local/antweb/ inside the container — files only land there
when ant deploy runs. This commit ensures that can never be missed again, and
bundles several related upload reliability improvements discovered during
investigation.

Deployment Pipeline:
- Add ant deploy to GitHub Actions so every push to master automatically
  compiles and deploys to the running Tomcat container via SSH
- Switch git pull --no-edit to git pull --rebase to eliminate stray merge
  commits on the production server (fixes orphaned commit 6b126f56)
- Add -T flag to docker compose exec for non-TTY GitHub Actions environment
  with v1/v2 fallback (docker compose || docker-compose)

Upload Reliability:
- Correct Cloudflare timeout guidance from "go back to homepage" to "check
  your Upload Report" — Tomcat continues processing after Cloudflare closes
  the browser connection, data is never lost
- Add JS loading overlay on upload submit with 85s auto-redirect to Upload
  Report before Cloudflare's 100s origin timeout fires
- Exempt /upload.do from Caddy rate limiter so upload retries after a
  Cloudflare timeout are never blocked by the 10 req/min per IP limit

Data Validation:
- Surface warning in upload report when spaces are auto-stripped from specimen
  codes (MessageMgr + SpecimenUploadParse) so curators can fix source data
  instead of silently receiving corrected but unexplained results

Bug Fix:
- Restore struts-configDb.xml and struts-configDbAnt.xml which were checked
  out as 22-byte symlink placeholder files on Windows, causing Struts
  ActionServlet to fail on startup and every .do action to return 404

All changes verified with a full local E2E test suite — 7/7 tests passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Was committed as a git symlink (mode 120000) causing CI checkout to fail
on Linux with 'unable to create symlink: File name too long'. Re-added
as a regular file (mode 100644) with the correct XML content.
Tests workflow was running docker build from docker/api/ subdirectory,
making COPY instructions fail with 'not found' since the Dockerfile
expects repo root as build context. Fixed to match docker-compose.yml
which correctly uses context: . with explicit -f Dockerfile path.
Also fixed Antweb build step which was pointing at docker/api instead
of docker/antweb.
@Gladrin22 Gladrin22 self-assigned this Mar 18, 2026
@Gladrin22 Gladrin22 requested review from antony-jr, foozleface and remarq and removed request for antony-jr March 18, 2026 09:00
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