Repository navigation
fix: allow single-character inline image content IDs - #151
pcbeingused33 wants to merge 1 commit into
Conversation
[Low risk] The change only lowers the trimmed content ID threshold from greater than one to greater than zero in setImage and AddImageFromFile, so null, empty and whitespace-only IDs still produce attachment disposition. It moves no dependency, and the added test covers both setters' serialized disposition, so the risk rests on a small behavioral change in one class. SummaryLets single-character content IDs produce inline disposition for image attachments Both What's good
Review context · 0/5 commands
Reviews (1) · Last reviewed commit: "fix: allow single-character inline image..." · claude-sonnet-5-5 |
Single-character image content IDs currently produce
attachmentdisposition rather thaninline, so an HTML reference such ascid:xcannot use the intended inline image.Both
setImageandAddImageFromFilerequire the trimmed content ID length to exceed one, although their documented contract only requires a nonempty ID. Accept a trimmed length greater than zero in both methods, preserving null, empty and whitespace-only handling.Testing and validation
Added 12 parameterized cases covering both image setters with single-character, longer, padded, null, empty and whitespace-only IDs. The tests check serialized disposition as well as ID, filename and base64 content. On main, four cases fail; with this change, all 12 pass under Java 11 using JUnit Jupiter. These tests use a local temporary file and make no API calls.
This change and its tests were generated with assistance from OpenAI Codex.