diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-27 08:37:20 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-27 08:37:20 +0300 |
| commit | 8defd48636eeebb3916809fc3f21c2e3d7c9ef5b (patch) | |
| tree | 3fba5ec27f49a788d5c753fcd4a3417a58c73ef5 /internal/post | |
| parent | 257057748a2cf2070fbeb722a94772857b5d014f (diff) | |
processor: reject two markdown files claiming the same inbox image
The pre-scan claimedByMarkdown used to mark an image as claimed by any
markdown that referenced it, but it did not prevent two different markdown
files from referencing the same image. When that happened, the first file
processed would copy the image into its post directory and then delete it
from the inbox. The second file then failed because the source image was
already gone.
Fix: make image claiming exclusive. claimedByMarkdown now tracks the
owning markdown filename for each claimed image and returns an error
immediately during the pre-scan if a conflict is detected. This way no
sources are removed and no partial posts are created.
Also add tests:
- twoMarkdownsClaimingSameImageFails (negative)
- duplicateImageClaimsInSameMarkdownAllowed (positive)
Diffstat (limited to 'internal/post')
0 files changed, 0 insertions, 0 deletions
