Skip to content

Wait for upload and analysis before enabling preview navigation - #285

Merged
nonprofittechy merged 6 commits into
mainfrom
fix/upload-readiness
Oct 8, 2026
Merged

nonprofittechy merged 6 commits into
mainfrom
fix/upload-readiness

Conversation

@nonprofittechy

@nonprofittechy nonprofittechy commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

While a lead document is still being analyzed, the upload page used to enable “Preview your PDFs,” sending the filer into a redirect back to upload. Keep that link unavailable during upload and pending analysis, and show a short wait message. Complete analysis and the manual-review fallback both enable navigation.

If analysis has not finished after two minutes (EXTRACTION_WAIT_LIMIT), the filer may continue and enter the case details by hand. The page says “This is taking longer than usual. You can continue and enter the case details yourself.” The server applies the limit in extraction review and reports the remaining wait to the page, so a worker that is down cannot strand the filer. The server decides when Continue opens. The page's own timer only matters if status checks keep failing, so a broken connection cannot strand the filer either. Replacing the lead restarts the wait. A result that arrives later only fills the suggested answers. Extracted amounts remain in analysis evidence and prefill the case-questions form; only a confirmed form submission writes the amount into filing and fee data.

Preserve the preview destination and return-to-Review detour. An analysis response arriving during a new upload cannot enable navigation prematurely. A failed extra upload restores the latest analysis status, including a ready result that arrived during the upload.

Validation: upload/extraction and preview regression coverage, JavaScript pending/completion/failure/race/wait-limit checks, full Python and JS suites, and an end-to-end run against a local server with the extraction worker stopped and running (see the comment below).

Closes #281.

🤖 Generated with Claude Code

Late-analysis regression coverage

Worker regression tests verify that results arriving after manual continuation preserve both blank and previously confirmed amounts and leave the fee fingerprint unchanged. Case-question tests verify suggestion display without persistence, preservation of confirmed amounts and invalid submitted text, and saving the filer’s confirmed amount. The focused extraction, people-flow, and fee-quote suites pass (96 tests).

nonprofittechy and others added 2 commits October 7, 2026 22:26
Continue stayed disabled until the status poll reported the analysis
ready, and extraction review sent filers back while it was pending. If
the extraction worker was down or backed up, or the poll kept failing,
the filer could not move forward at all.

After EXTRACTION_WAIT_LIMIT the filer may continue and enter the case
details by hand. The server enforces the limit in extraction review and
reports the remaining wait to the page, which opens Continue on a timer
so a failing status poll cannot hold it shut. Replacing the lead
restarts the wait. A late result still only fills extracted_guesses.

Also keep the analysis status the upload page shows in one place, so a
failed extra upload goes back to the latest status, including a ready
result that arrived during the upload, rather than an older snapshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page opened Continue from its own timer. On a machine whose wall
clock drifted against the browser's timers (about 8% on the WSL2 box
used for end-to-end checks), it did so before the server had ended the
wait, and the click was sent back to upload.

Continue now opens when a status check reports the wait is over. The
page's timer only matters if status checks keep failing: once it has
run, a failed check opens Continue, so a broken connection still cannot
hold the filer on the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nonprofittechy

Copy link
Copy Markdown
Member Author

End-to-end check against a local server (real Tyler test sign-in). Screenshots: https://gist.github.com/nonprofittechy/80259c2d4c6db7e103bae9780597fce3

  • Worker stopped: Continue stays disabled, and opening extraction review directly is redirected. After two minutes the page says "This is taking longer than usual. You can continue and enter the case details yourself.", Continue opens, and the filer reaches the manual "Tell us about your case" page.
  • Worker running: while the first file is read, a rejected extra upload (notes.exe) shows its error and the status stays "Reading your first file…". When analysis finishes, the page shows "Document analysis is ready" and Continue opens.

This run also found that the page's own timer could open Continue a few seconds before the server ended the wait (this machine's wall clock drifts about 8% against the browser's timers), which bounced the click back to upload. Fixed in ae263db: the server's status checks now decide, and the timer only matters while those checks are failing.

🤖 Generated with Claude Code

@nonprofittechy
nonprofittechy merged commit bcd44e0 into main Oct 8, 2026
8 checks passed
@nonprofittechy
nonprofittechy deleted the fix/upload-readiness branch October 8, 2026 16:58
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.

Remove "You can leave this page and come back while we work"

1 participant