Skip to content

feat: patch umya-spreadsheet to fix 12 of 15 XLSX panics#90

Merged
developer0hye merged 3 commits intomainfrom
ralph/phase18-fix-umya-spreadsheet
Mar 1, 2026
Merged

feat: patch umya-spreadsheet to fix 12 of 15 XLSX panics#90
developer0hye merged 3 commits intomainfrom
ralph/phase18-fix-umya-spreadsheet

Conversation

@developer0hye
Copy link
Owner

Summary

  • Fork and patch umya-spreadsheet (v2.3.3) to replace 15+ panic-causing unwrap() calls and panic!() macros with graceful error handling
  • Integrate the patched fork via [patch.crates-io] in workspace Cargo.toml
  • Add comprehensive tests verifying all 22 previously-problematic XLSX files

Changes

umya-spreadsheet fork (fix/panic-safety-v2)

Fixes applied to 11 files in the fork:

Category Files Fixed Change
FileNotFound (7 panics) raw_file.rs Skip missing zip entries instead of unwrap()
dataBar EOF (2 panics) data_bar.rs, icon_set.rs return on EOF instead of panic!()
iconSet bug icon_set.rs Fix copy-paste: looked for "dataBar" end element instead of "iconSet"
ParseIntError overflow (2 panics) u_int32_value.rs, int32_value.rs try_from with fallback for out-of-range values
ParseFloatError (1 panic) number_format.rs, number_formater.rs, percentage_formater.rs unwrap_or defaults for numeric parsing
unwrap on None (3 panics) stylesheet.rs, cell.rs, conditional_formatting_rule.rs if let/unwrap_or_default for missing styles/elements

office2pdf integration

Results

Category Before After Improvement
Panicking files 15 3 12 files fixed (80%)
Successfully converting 0 of 15 12 of 15 +12 files
Clean error (no crash) 0 of 15 3 of 15 Remaining panics caught by catch_unwind
Parse error files 7 7 Unchanged (zip-level errors)

Files now converting successfully (12)

  • chart_hyperlink.xlsx, hyperlink.xlsx, tdf130959.xlsx, test_115192.xlsx
  • 47504.xlsx, bug63189.xlsx, ConditionalFormattingSamples.xlsx
  • check-boolean.xlsx, tdf100709.xlsx, sample-beta.xlsx
  • tdf162948.xlsx, NewStyleConditionalFormattings.xlsx

Files still failing with clean errors (3)

  • functions-excel-2010.xlsx — arithmetic overflow in formula parsing
  • FormulaEvalTestData_Copy.xlsx — arithmetic overflow in formula parsing
  • 64450.xlsxunwrap() on None in a different code path

Test plan

  • Fork's own test suite passes (88 tests)
  • cargo test --workspace passes
  • cargo fmt --all -- --check passes
  • cargo clippy --workspace -- -D warnings passes
  • All 12 newly-fixed files produce valid PDFs
  • Remaining 3 panic files return clean Err (no process crash)
  • All 7 parse-error files still return appropriate errors

Related: #83

🤖 Generated with Claude Code

Add [patch.crates-io] to use developer0hye/umya-spreadsheet fork
(fix/panic-safety-v2 branch) which replaces 15+ panic-causing
unwrap() calls with graceful error handling.

Files that previously panicked (e.g., chart_hyperlink.xlsx,
check-boolean.xlsx) now convert successfully. Update the test
to reflect this improvement.

Related: #83

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Cargo.lock is in .gitignore for this library workspace.

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Add comprehensive tests for all 15 previously-panicking XLSX files:
- 12 files now convert successfully (were: FileNotFound, ParseFloatError,
  unwrap on None, dataBar EOF panics)
- 3 files still return clean errors via catch_unwind (arithmetic overflow
  and remaining unwrap on None in other code paths)

All 7 previously-erroring files remain unchanged (zip-level errors).

Summary: panic count reduced from 15 to 3 (80% improvement),
successful conversions increased by 12 files.

Related: #83

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye developer0hye merged commit 8c9d83d into main Mar 1, 2026
26 of 27 checks passed
@developer0hye developer0hye deleted the ralph/phase18-fix-umya-spreadsheet branch March 1, 2026 09:36
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