Skip to content

Fix bug concerning incorrect process status when sharing large files (>2.15GB)

Problem:

When sharing a large file from my Phone (Android 10) to my Desktop(Kubuntu 19.10) I noticed that the file size was not displayed correctly (it was way lower than it should be). Also, the progress bar on the phone and the desktop was at 100% before the upload was even close to be finished.

Reason:

After some debugging I think I found the underlying problem:

The file that was send was 22242370020 Bytes (~22 GB) large. KDE Connect reported that I was transferring a 730 MB file. Since 22242370020 mod (2^31)-1 (int's maximum value) is just about 700 MB it's pretty clear that an integer was accidentally used to store the file size.

Solution:

The FileHelper was using Androids Cursor class to get the file size. Changing getInt to getLong for fetching the size is all that needed to be done.

Further Problems:

The Android app displays the status bar correctly now and also seems to send the correct value to the Desktop before transmitting the file. Anyways the desktop app appears to interpret the number as an int as well. The Problem still persists there. Unfortunately, I'm not a c++ developer and wasn't able to fix this issue right away.

Let me know if I should raise an issue!

Merge request reports