Skip to content

Fix/444 shared export filename#445

Closed
tejassinghbhati wants to merge 6 commits intoEAPD-DRB:mainfrom
tejassinghbhati:fix/444-shared-export-filename
Closed

Fix/444 shared export filename#445
tejassinghbhati wants to merge 6 commits intoEAPD-DRB:mainfrom
tejassinghbhati:fix/444-shared-export-filename

Conversation

@tejassinghbhati
Copy link
Copy Markdown
Contributor

Linked issue: Closes #444

Existing related work reviewed:

Overlap assessment:

Why this PR should proceed:

Summary:

  • import uuid added to CaseRoute.py
  • prepareCSV generates a per-request unique filename (export_<uuid>.csv) and stores it in session['export_file']
  • downloadCSV reads session['export_file'] instead of the hardcoded path; falls back to export.csv for backward compatibility; returns 404 if the file doesn't exist instead of crashing

Validation:

Proposed track: Track: Stability

…/CI server flakiness

- Replace subprocess server launch with an in-process Waitress daemon thread.
  This eliminates cross-platform CWD/sys.path/env-var inheritance issues that
  caused page.goto() timeouts on Python 3.12 Windows when using Flask dev server.
- Configure Waitress with threads=16 and channel_timeout=10 to prevent thread
  exhaustion during Playwright's burst of concurrent static asset requests.
- Use wait_until='commit' on all page.goto() calls so browser tests return the
  instant Flask starts sending bytes, without blocking on CDN resources (MathJax)
  or synchronous <script> downloads that precede DOM parsing.
- Scope assertions to elements guaranteed present in raw server-rendered HTML:
  page title (in <head>), footer copyright text (hardcoded in index.html).
- All 4 tests now pass locally in 8s: test_health_endpoint, test_session_api,
  test_load_app, test_static_footer.
@github-actions github-actions Bot added the needs-intake-fix PR intake structure needs maintainer follow-up label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-intake-fix PR intake structure needs maintainer follow-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Shared export.csv filename in prepareCSV/downloadCSV causes silent data corruption under concurrent use

1 participant