Bug #709
closedPrivacy Browser's UI freezes when downloading large files quickly
Added by disda redmine over 3 years ago. Updated over 3 years ago.
0%
Description
here's my device info. the app started to freeze after downloading 20MB from the given link (libreoffice.rpm.tar.gz).
cheers
Files
Privacy Browser Version.txt (1.1 KB) Privacy Browser Version.txt | disda redmine, 05/14/2021 12:08 AM |
Updated by Soren Stoutner over 3 years ago
- Assignee set to Soren Stoutner
1. Approximately how many seconds after the download started did you get to 20 MB and the GUI froze? Does it always freeze after the same amount of time has passed?
Updated by disda redmine over 3 years ago
Soren Stoutner wrote:
1. Approximately how many seconds after the download started did you get to 20 MB and the GUI froze? Does it always freeze after the same amount of time has passed?
alright. i did a little bit tinkering around and here's the result:
1) if i connect my phone to a slower wifi, there's no freezing.(after downloading 21 MB, the app is doing normal)
2) on high-speed connection(like 1MB/s), things get slower after getting 21MB and freezing started after about 23 secs(23 MB). the higher the speed of the connection, the sooner the freezing would happen.(lol sorry for my english tho)
my guess? it's somehow related to how fast the browser is gathering data. i never experience this behaviour before v3.7 FWIW.
Updated by Soren Stoutner over 3 years ago
For others who might want to test to try to figure out what is going on, the URL we are using is https://www.libreoffice.org/donate/dl/rpm-x86_64/7.1.3/en-US/LibreOffice_7.1.3_Linux_x86-64_rpm.tar.gz which is a 257 MB download. The specific download does not seem to be the issue, but rather something related to how long the download runs.
Updated by Soren Stoutner over 3 years ago
So far I have been unable to replicate the problem. I have tested using a Pixel 5 running Android 11 (API 30) and an emulated device running Android 7.0 (API 24). In all cases the download speed of the devices exceeds 50 Mbps.
Updated by Soren Stoutner over 3 years ago
Here is a link to a video showing the download of the file on my Pixel 5.
https://download.stoutner.com/privacy-browser/redmine/Download%20Large%20File.mp4
Updated by Soren Stoutner over 3 years ago
- Subject changed from [3.7]app hangs on downloading big files to Privacy Browser's UI freezes when downloading large files quickly
Updated by Soren Stoutner over 3 years ago
I think I may have found the root cause of the problem. The system was set to update the snackbar with the download percentage every time a kilobyte was downloaded. But updating the snackbar can be CPU intensive, which can lock the interface on devices with slower CPUs. The faster the download proceeded, the more the problem would manifest. The OS keeps a queue of pending UI updated, so for the few few seconds the system would stay responsive, but once the queue filled up with a backlog of snackbar updates the UI would freeze.
I have changed the snackbar to only force an update every time a megabyte is downloaded (although it will update more frequently on slower connections every time the download buffer is emptied). This keeps the UI responsive on an old Nexus 7 tablet, which has a fairly wimpy CPU.
Updated by Soren Stoutner over 3 years ago
You can use the following URL to download a debug build if you would like to test the change on your device. If for some reason it still doesn't work we can experiment with update values higher than 1 megabyte.
https://owncloud.stoutner.com/index.php/s/wwuJDs9JwvqDYlk
Note that the link will expire in a few days.
Also note that you will not be able to install the debug build over your current app. Rather, you should export all your settings, uninstall you current copy of Privacy Browser, install the debug build, test downloads, uninstall the debug build, reinstall your current copy of Privacy Browser, and restore settings from your backup file. You can import your settings from the production build to the debug build, but because of database schema changes you will not be able to go the other direction; you cannot import settings from the debug build back into your 3.7 or upcoming 3.8 production builds.
Updated by Soren Stoutner over 3 years ago
- Status changed from New to Closed
Updated by Soren Stoutner over 3 years ago
Regarding how you never had this problem before version 3.7, there was a change in version 3.7 that increased the amount of information shown in the snackbar, which increases the amount of CPU calculations that is required every time the snackbar is updated.
Updated by disda redmine over 3 years ago
Soren Stoutner wrote:
You can use the following URL to download a debug build if you would like to test the change on your device. If for some reason it still doesn't work we can experiment with update values higher than 1 megabyte.
https://owncloud.stoutner.com/index.php/s/wwuJDs9JwvqDYlk
Note that the link will expire in a few days.
Also note that you will not be able to install the debug build over your current app. Rather, you should export all your settings, uninstall you current copy of Privacy Browser, install the debug build, test downloads, uninstall the debug build, reinstall your current copy of Privacy Browser, and restore settings from your backup file. You can import your settings from the production build to the debug build, but because of database schema changes you will not be able to go the other direction; you cannot import settings from the debug build back into your 3.7 or upcoming 3.8 production builds.
i can confirm it's all working now. i was able to download the whole file while working with 5 tabs.
I've got to thank you for the time and effort you've given to this project. it's been an honor to be your tester too.
Updated by Soren Stoutner over 3 years ago
- Priority changed from 3.x to Next Release