Bug 496010

Summary: Saved images on Android are zero bytes
Product: [Applications] Tokodon Reporter: Joshua Goins <josh>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: carl, josh
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Android   
OS: Linux   
Latest Commit: Version Fixed In: 24.12
Sentry Crash Report:

Description Joshua Goins 2024-11-09 14:10:17 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***
The file is created, but it's zero bytes.


SUMMARY


STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Joshua Goins 2024-11-10 20:24:35 UTC
Git commit 81ff09be60b2e81f4c01db93364fe4f09b03ed25 by Joshua Goins.
Committed on 10/11/2024 at 20:24.
Pushed by redstrate into branch 'master'.

Fix files not saving on Android

It turns out to be two little nagging bugs. First, we are checking if
the temporary file is readable on Android (it never is) and fails.
Secondly, we need to not convert the content:// URI to a local file URI
since that fails. Finally, we need to enable direct write fallback for
QSaveFile because yet again, we cannot write anywhere else in the
directory on Android.

M  +7    -2    src/utils/filehelper.cpp
M  +1    -1    src/utils/filehelper.h
M  +6    -2    src/utils/filetransferjob.cpp

https://invent.kde.org/network/tokodon/-/commit/81ff09be60b2e81f4c01db93364fe4f09b03ed25
Comment 2 Joshua Goins 2024-11-10 20:24:59 UTC
Git commit 2f278e970dcc107cfa8b61fdc13377651146314b by Joshua Goins.
Committed on 10/11/2024 at 20:24.
Pushed by redstrate into branch 'release/24.12'.

Fix files not saving on Android

It turns out to be two little nagging bugs. First, we are checking if
the temporary file is readable on Android (it never is) and fails.
Secondly, we need to not convert the content:// URI to a local file URI
since that fails. Finally, we need to enable direct write fallback for
QSaveFile because yet again, we cannot write anywhere else in the
directory on Android.
(cherry picked from commit 81ff09be60b2e81f4c01db93364fe4f09b03ed25)

M  +7    -2    src/utils/filehelper.cpp
M  +1    -1    src/utils/filehelper.h
M  +6    -2    src/utils/filetransferjob.cpp

https://invent.kde.org/network/tokodon/-/commit/2f278e970dcc107cfa8b61fdc13377651146314b