Repository navigation
M14: preserve existing PDF suffixes in web exports - #6817
Conversation
Recognize an existing PDF extension without changing its case or the requested filename.
Assert exact delivered filenames and PDF bytes for lowercase, uppercase, mixed-case Unicode and missing suffixes.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
does this handle all filenames, potentially hostile? is there a way to express this logic more robustly? |
Added additional test cases for PDF file name handling in file dialogs.
FredApps
left a comment
There was a problem hiding this comment.
Reviewed 5f228a0. The bounded four-byte suffix comparison preserves the requested filename and is safe for short and multibyte UTF-8 names. It matches the existing I/O extension dispatch, which normalizes ASCII case before selecting the PDF writer. The WordApp callback regression checks both the actual delivered filename and PDF signature across mixed-case, Unicode, short and misleading-suffix cases. No blocking issue found. Exact-head CI, all three printing platforms and Sonar scan passed; coverage skipped. I did not run an additional local build.
An explicit web
file.exportPdfrequest forReport.PDFcurrently downloadsReport.PDF.pdf: the download branch recognizes only a lowercase.pdfsuffix, although the existing I/O dispatcher accepts extension case. Make that suffix check ASCII case-insensitive while preserving the exact requested filename.Add a WordApp regression with a download callback that checks the delivered name and PDF header for lowercase, uppercase, mixed-case Unicode and missing-suffix inputs.
Validation: the exact filename expression passes all 3 focused Rust probe cases with this change; the original expression fails the mixed/uppercase group (2 passed, 1 failed). Complete modified files pass rustfmt. Independent source/API review, including the current download callback signature, found no issue; both browser baselines match the reviewed source. Full WordApp/UI/wasm tests and the workspace gate did not run locally; hosted checks on head
3e776e4c7d6fb901d2439738b9ced1513ec2c426remain pending.Searched issues and open/closed PRs for
file.exportPdf, extensions and duplicate PDF suffixes. Closed #212 covers the edited indicator after downloads; the existing Save As work covers separate chooser behavior.Summary by CodeRabbit
.pdfextension regardless of capitalization and add the extension when it’s missing.