Skip to content

Fix print crash on short journal headers - #21

Closed
marsicdev wants to merge 2 commits into
main-v3from
fix/pdf-header-crash
Closed

marsicdev wants to merge 2 commits into
main-v3from
fix/pdf-header-crash

Conversation

@marsicdev

@marsicdev marsicdev commented Sep 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes production crash IndexOutOfBoundsException: toIndex = 6 in PDF creation when printing invoices whose journal header block has fewer than 6 lines (seen with proforma receipts).
  • Header parsing now uses drop/take instead of hard subList indices, so any header length renders instead of crashing.
  • Adds temporary [DEBUG-pdf] diagnostic logging (Logcat + Crashlytics breadcrumb) to confirm which malformed journal shape reaches the parser; tagged for easy removal.
  • Bumps version to 3.5.2 and updates CHANGELOG.

Testing

  • Compile verified (compileDebugKotlin, printVersionInformation prints 3.5.2).
  • Runtime behavior on device unverified; crash repro was confirmed with the exact exception via a since-removed local check.

Replace hard subList indices in CreatePdf with drop/take so journal
headers with fewer than 6 lines (e.g. proforma receipts) no longer
throw IndexOutOfBoundsException on print. Add temporary [DEBUG-pdf]
logging to Logcat and Crashlytics to identify the malformed journal
shape. Bump version to 3.5.2.

Claude-Session: https://claude.ai/code/session_01MqPHhmoisS6SCg3E6umn2L
Send the PDF journal diagnostics to Crashlytics as a non-fatal only
when the journal is malformed, include receipt content in the log
solely on that path, and remove CLAUDE.md from version control.

Claude-Session: https://claude.ai/code/session_01MqPHhmoisS6SCg3E6umn2L
@marsicdev marsicdev closed this Sep 1, 2026
@marsicdev
marsicdev deleted the fix/pdf-header-crash branch September 1, 2026 10:15
@marsicdev marsicdev mentioned this pull request Sep 1, 2026
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