-
Notifications
You must be signed in to change notification settings - Fork 278
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
Fix: If two images are posted within the same second, only the first one will be saved. #2075
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what this is fixing, please provide some more context
Here is the issue I have work on: element-hq/element-web#29079 |
Hello! You've updated the PR title but the description still links to the bug that this PR doesn't fix. I don't think there is a bug for the behaviour this PR is actually changing, and I'm not really sure how much of a problem it would be: most browsers will automatically append a '(1)' or similar if a file already exists by the same name. This would mean all downloaded files get a timestamp appended which doesn't seem desirable. I think the best thing to do here might to apply a similar change to fix the original bug, which would be in the element-web repo, which I think would be https://github.com/element-hq/element-web/blob/a0044d6b5f841acd48870dcc99ff6f27f0248f61/src/utils/exportUtils/HtmlExport.tsx#L378 and corresponding places in the other exporters, ideally. |
Checklist
public
/exported
symbols have accurate TSDoc documentation.My approach to solve the issue:
Added a timestamp to the filename:
Used Date.now() to get the current time in milliseconds.
Modified the targetFileName to include the timestamp, ensuring uniqueness.
Closes element-hq/element-web#29079