Skip to content

Fix issue with duplicate images - #30073

Merged
t3chguy merged 3 commits into
element-hq:developfrom
fatlewis:29079-fix-issue-with-duplicate-images
Jun 4, 2025
Merged

t3chguy merged 3 commits into
element-hq:developfrom
fatlewis:29079-fix-issue-with-duplicate-images

Conversation

@fatlewis

@fatlewis fatlewis commented Jun 3, 2025

Copy link
Copy Markdown
Contributor

Fixes #29079.

I've added a method on the Exporter class to track duplicate file names and append an incrementing number to the duplicates, e.g.:

"foo/bar/file.txt"
"foo/bar/file (1).txt"
"foo/bar/file (2).txt"

I've also added a test for this feature to the HTMLExport test suite, as that was the area in which the issue was discovered. While adding this test I found that the mock for createMessagesRequest wasn't resolving the correct value, which meant that tests were duplicating events, so I've corrected that (I'm a bit surprised this wasn't discovered before).

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation. (N/A)
  • Linter and other CI checks pass.
  • I have licensed the changes to Element by completing the Contributor License Agreement (CLA)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Defect Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some pictures are lost when exporting chat

2 participants