You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched open and closed issues for duplicates
I am submitting a bug report for existing functionality that does not work as intended
This isn't a feature request or a discussion topic
Bug description
Starting on Monday, 30 December 2024, until the beginning of 2025, attachments sent from Signal iOS which get automatic signal-... filenames erroneously write the year as 2025 instead of 2024. This bug does not seem to occur when sending from Signal Android.
I believe this is because Signal iOS is not actually getting the year number, but the year associated with the ISO week number. As the majority of the days in the week of 30 December (starting on Monday) are in 2025, the ISO week date calendar considers the week as the first of 2025, rather than the last of 2024:
$ date +%F
2024-12-31
$ date +%G-W%V
2025-W01
Relevant code (as far as I can tell) in SignalServiceKit/Attachments/SignalAttachment.swift:
// Use the filename if known. If not, e.g. if the attachment was copy/pasted, we'll generate a filename
// like: "signal-2017-04-24-095918.zip"
publicvarfilenameOrDefault:String{
if let filename = sourceFilename {return filename.filterFilename()}else{letkDefaultAttachmentName="signal"letdateFormatter=DateFormatter()
dateFormatter.dateFormat ="YYYY-MM-dd-HHmmss"letdateString= dateFormatter.string(from:Date())letwithoutExtension="\(kDefaultAttachmentName)-\(dateString)"
if let fileExtension =self.fileExtension {return"\(withoutExtension).\(fileExtension)"}return withoutExtension
}}
A common mistake is to use YYYY. yyyy specifies the calendar year whereas YYYY specifies the year (of “Week of Year”), used in the ISO year-week calendar. In most cases, yyyy and YYYY yield the same number, however they may be different. Typically you should use the calendar year.
Steps to reproduce
On Signal iOS, send an image that will get recompressed or converted, between 30 December 2024 and the beginning of 2025
On any Signal app, download the image from the conversation
Actual result: The file is named like signal-2025-12-31-012345.jpeg
Expected result: The file is named like signal-2024-12-31-012345.jpeg
The text was updated successfully, but these errors were encountered:
Bug description
Starting on Monday, 30 December 2024, until the beginning of 2025, attachments sent from Signal iOS which get automatic
signal-...
filenames erroneously write the year as 2025 instead of 2024. This bug does not seem to occur when sending from Signal Android.I believe this is because Signal iOS is not actually getting the year number, but the year associated with the ISO week number. As the majority of the days in the week of 30 December (starting on Monday) are in 2025, the ISO week date calendar considers the week as the first of 2025, rather than the last of 2024:
Relevant code (as far as I can tell) in
SignalServiceKit/Attachments/SignalAttachment.swift
:See Apple's documentation:
Steps to reproduce
Actual result: The file is named like
signal-2025-12-31-012345.jpeg
Expected result: The file is named like
signal-2024-12-31-012345.jpeg
The text was updated successfully, but these errors were encountered: