krille-chan / fluffychat

The cutest instant messenger in the [matrix]
https://fluffychat.im/
GNU Affero General Public License v3.0
1.19k stars 215 forks source link

[BUG]: FluffyChat doesn't trim long filenames #874

Open RoootTheFox opened 9 months ago

RoootTheFox commented 9 months ago
### Exception
FileSystemException: Cannot open file, path = '/data/user/0/chat.fluffy.fluffychat/cache/attachments%7C578763260682043412%7C1177665643655475312%7Cy2mate.is_-_One_to_Ten_shorts_fortnite_gaming_animation_animated_meme_fyp_art_kit_meowskulls_funny-I8sv1uY27Fw-720p-1700770049.mp4_y2mate.is_-_One_to_Ten_shorts_fortnite_gaming_animation_animated_meme_fyp_art_kit_meowskulls_funny-I8sv1uY27Fw-720p-1700770049.mp4' (OS Error: File name too long, errno = 36)

### StackTrace
#0      _checkForErrorResponse (dart:io/common.dart:55)
#1      _File.open.<anonymous closure> (dart:io/file_impl.dart:381)
<asynchronous suspension>
#2      _File.writeAsBytes.<anonymous closure> (dart:io/file_impl.dart:634)
<asynchronous suspension>
#3      EventVideoPlayerState._downloadAction (package:fluffychat/pages/chat/events/video_player.dart:47)
<asynchronous suspension>

FluffyChat seems to not trim filenames if they're too long.

RoootTheFox commented 9 months ago

just checked, this also happens on 1.17.3 (latest version)

LFd3v commented 9 months ago

Can you please confirm if it is running on Android? If yes, what version? Thank you.

RoootTheFox commented 9 months ago

yes, it is running on android.

Software/HW information:

on another note: this could also be mitigated by hashing the URL, and using the hash as internal filename instead.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 120 days with no activity.