fix: multi-file password state loss, silent empty success, and zombie Java process on timeout#65
Merged
Merged
Conversation
Pass filteredStatement to all optional Excel analytics sheets so filters like "exclude charges" and sort order are consistently applied. The Charges & Fees sheet intentionally retains the unfiltered statement since its sole purpose is to display charge transactions.
…aves Java running Bug 1 – preserve already-processed statements in a ref when a mid-batch file triggers a password prompt so handlePasswordSubmit doesn't rebuild the list from stale (empty) React state. Bug 4 – throw an error after parseTabulaCSV when zero transactions are found so the UI reaches ERROR rather than a silent SUCCESS screen. Bug 5 – switch Tabula spawn from output() to spawn()+wait_with_output(), store the child PID in Tauri managed state, and add a cancel_pdf_extraction command. The TS timeout now calls that command before rejecting so the Java process is killed rather than left running in the background.
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
Three bug fixes, each with its own patch changeset.
Bug 1 — Multi-file password state loss
When processing a batch and a mid-batch file triggers the password prompt,
processFilesreturned early without callingsetStatements.handlePasswordSubmitthen builtupdatedStatementsfrom the React state (always[]at that point), silently dropping every file processed before the protected one.Fix: a
pendingStatementsref captures the already-processed statements whenever a password is needed.handlePasswordSubmitseeds its list from the ref (and updates it again if another file in the same batch also needs a password).Bug 4 — Silent empty success
If
parseTabulaCSVfound no recognisable header (wrong PDF, scan artefacts, etc.) it returned{ transactions: [] }.processFilespushed that onto the batch and ultimately showed a SUCCESS screen with "0 transactions" — no indication anything was wrong.Fix: after
parseTabulaCSV, throw iftransactions.length === 0. The existing catch block routes this to the ERROR state with a clear message.Bug 5 — Timeout leaves Java running
Promise.racewith a 60 s timeout rejected the UI-side promise but left the Rustextract_pdf_tablescommand (and its Java/Tabula subprocess) running indefinitely.Fix (Rust): switched from
cmd.output()tocmd.spawn()+child.wait_with_output(), storing the child PID in Tauri-managedActivePidstate. A newcancel_pdf_extractioncommand reads and clears the PID then kills the process (kill -9/taskkill /F).Fix (TS): the timeout handler now calls
invoke("cancel_pdf_extraction")before rejecting, and.finally(() => clearTimeout(...))on the extraction promise prevents the timer firing after a normal completion.Test plan