Skip to content

Fix issue with duplicate images #30073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

fatlewis
Copy link
Contributor

@fatlewis fatlewis commented Jun 3, 2025

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)

Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane, thanks!

@t3chguy t3chguy added this pull request to the merge queue Jun 4, 2025
Merged via the queue into element-hq:develop with commit 9c0604f Jun 4, 2025
30 checks passed
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