Crashloop when attachment with size as string is found #7406
Labels
A-Media
crash
O-Uncommon
Most users are unlikely to come across this or unexpected workflow
S-Critical
Prevents work, causes data loss and/or has no workaround
T-Defect
Something isn't working: bugs, crashes, hangs and other reported problems
Steps to reproduce
FileInfo
part (https://spec.matrix.org/v1.6/client-server-api/#mfile) of them.file
event as string rather than integer.Outcome
What did you expect?
I would not expect the app to crash. Not rendering a message, rendering it with an error or just the missing size would be deisreable. Continously crashing the app is not.
What happened instead?
The crash happens in the code responsible for formatting the event to text. There the code assumes that the object in the dictonary is always a number and it is safe to convert it into a
long
value. The code is missing required type checks in at least these cases.I've validated the situation using the below patch which fixed it in my simulator. This was my very first piece of Objective-C/iOS development so I don't think this is good enough to go in as a PR.
Your phone model
IPhone 14 & IPhone 14 Pro in Simulator
Operating system version
iOS16.3
Application version
latest develop branch (47d50d7)
Homeserver
Synapse 1.76 / my personal instance
Will you send logs?
I did once after turning the homeserver off as otherwise the app continously crashes.
The text was updated successfully, but these errors were encountered: