[BUG] Some images previews are visible on web interface and not on Android app
Actual behaviour
Installed and uninstalled the app many times. First time it runs all of the images have their preview (folder with more than 2000 images but it happens regardless of the number of images stored in a folder). After the 2nd time I run owncloud app some previews are not visible anymore. If I actually open one of that images without the preview, the preview will "stick" and will not disappear anymore. Each and every time I close and reopen the app, previews are randomly visible or not visible.
Expected behaviour
All images previews should be always visible in each and every folder, every time I run the app.
Steps to reproduce
- Instal the app, run it first time, open a folder, previews are all there
- Re-run the app -> not all of the previews are visible anymore
- If I open the web interface images previews are all there, so I guess it is an app bug
Can this problem be reproduced with the official owncloud server? (url: https://demo.owncloud.org, user: test, password: test) I don't know
Environment data
Android version: 14 Device model: Xiaomi 12 Pro Stock or customized system: Stock ownCloud app version: 4.3.0 ownCloud server version: 10.14.0.3
Logs
Web server error log
Insert your webserver log here
ownCloud log (data/owncloud.log)
Insert your ownCloud log here
previews means thumbnails, right? the little image on the left. On my side, i can not reproduce it, thumbnails are there. That images are generated in the server and retrieved from there, so, there is also some dependency on that side. Will take a look again anyway.
If you can provide logs, or also, a test account in your server (we'd tell you how to give that information in a secure way), it could be helpful for dev team.
thumbnails
Yep, I meant thumbnails. The same goes for video, pdf, txt etc etc. I have the same behaviour also on a tablet of mine, total erratic behaviour, sometime thumbnails appear sometime not. On the web interface (I tested also the very beautiful "web app") no problems at all, both on desktop and mobile browser. I could provide for sure a test account if you need it, just let me know, thanks.
In case of the Android app, only the thumbnails that server retrieves are shown in the app: images and txt files. PDFs and other formats lack of server generated thumbnails. Don't compare with desktop client because are pretty different scopes and work in a different way. I will provide you a place where you can push the info. Thanks a lot!
In case of the Android app, only the thumbnails that server retrieves are shown in the app: images and txt files. PDFs and other formats lack of server generated thumbnails. Don't compare with desktop client because are pretty different scopes and work in a different way. I will provide you a place where you can push the info. Thanks a lot!
Ok, at least I know there is no problem with PDFs and other formats. Nevertheless images thumbnails are not working as intended. Please have a look at attached screenshots.
https://infinite.owncloud.com/s/nYSfrsmANDXWKzJ
Pwd: aa55AA..
There, you can upload any file with information about your test server. We strongly appreciate your feedback.
https://infinite.owncloud.com/s/nYSfrsmANDXWKzJ
Pwd: aa55AA..
There, you can upload any file with information about your test server. We strongly appreciate your feedback.
Ok. What do you need? Logs with a certain details of logging? I can't seen any error at "error" log level.
it's enough with information about a test server. Logs could help as well.
I have the same issue, and can't see anything in the log. It has persisted across multiple versions of the android app. Is this the same as https://github.com/owncloud/android/issues/3525 ?
I have the same issue, and can't see anything in the log. It has persisted across multiple versions of the android app. Is this the same as #3525 ?
@benedictgoodman it is exactly the same. I made some tests, deleted a folder with issues and shared again and the problem disappeared. So I guess that bug is still there. Actually images preview from Android is unusable, I can't believe it is a rare thing, I have the same behaviour on another android tablet as well.
I have the same issue, and can't see anything in the log. It has persisted across multiple versions of the android app. Is this the same as https://github.com/owncloud/android/issues/3525 ?
i don't think so. In that issue, problem happens only in grid view, now you reported the problem in list view, right? Checked again, i see all thumbnails in two different servers/devices. We can not control every single server (don't forget, server is who generates the thumbnails, not the mobile device), for that reason we'd need extra info about the problem in logs, or in a test account.
I have the same issue, and can't see anything in the log. It has persisted across multiple versions of the android app. Is this the same as #3525 ?
i don't think so. In that issue, problem happens only in grid view, now you reported the problem in list view, right? Checked again, i see all thumbnails in two different servers/devices. We can not control every single server (don't forget, server is who generates the thumbnails, not the mobile device), for that reason we'd need extra info about the problem in logs, or in a test account.
How can I give a temp account detail to you in a private fashion?
How can I give a temp account detail to you in a private fashion?
https://github.com/owncloud/android/issues/4443#issuecomment-2242622534
Thanks @Anycubic but i only see credentials without a server URL to attach them to.
@jesmrec sorry I re-uploaded the file
Checking with your server, where i pushed a big amount of thumbnailed files (txt and images). Thumbnails loaded correctly. I will clarify how the thumbnails feature works:
- Only txt files and images (not all formats are supported). Thumbnails are generated in server and mobile app retrieves them
- Mobile app retrieves thumbnails one by one, and then loaded. This is not very performant and we are aware of it.
- Mobile app asks the server for the thumbnails at the time you scroll down. That means, in a list of 2000 files, the latest file will ask for its thumbnail when it is on the screen, not before. If you don't scroll down, only thumbnails on the top of the list are fetched.
- If you scroll down very fast in a long list of files, the files on the bottom will take some time to appear. This is a collateral effect of the one-by-one operation.
- Thumbnails are cached. Only retrieved the first time.
Checking the steps on the top message.
Re-run the app -> not all of the previews are visible anymore
are there thumbnails that were visible, and then not-visible?? anything that happened in the middle?
Checking with your server, where i pushed a big amount of thumbnailed files (txt and images). Thumbnails loaded correctly. I will clarify how the thumbnails feature works:
- Only txt files and images (not all formats are supported). Thumbnails are generated in server and mobile app retrieves them
- Mobile app retrieves thumbnails one by one, and then loaded. This is not very performant and we are aware of it.
- Mobile app asks the server for the thumbnails at the time you scroll down. That means, in a list of 2000 files, the latest file will ask for its thumbnail when it is on the screen, not before. If you don't scroll down, only thumbnails on the top of the list are fetched.
- If you scroll down very fast in a long list of files, the files on the bottom will take some time to appear. This is a collateral effect of the one-by-one operation.
- Thumbnails are cached. Only retrieved the first time.
Checking the steps on the top message.
Re-run the app -> not all of the previews are visible anymore
are there thumbnails that were visible, and then not-visible?? anything that happened in the middle?
I started again from scratch. Uninstalled the app on Android, installed again. I opened "CameraUpload" folder where I have more than 2k photos and waited for all of the thumbnails to get loaded, eveything ok. I than opened another folder, thumbnails where not there and not being loaded. Went back to "CameraUpload" folder and thumbnails disappeared! I then stopped the app, re-opened it and CameraUpload folder was not showing a single thumbnail while other folders started to populate (the same folders which didn't show anything during the first run after reinstall cycle). The third time I opened the app also that folders which started to show thumbnails started to get "crazy" and showing not all of the previews (?). To wrap up:
- uninstalling and reinstalling the app DOES something
- unfortunately the app starts to show and hide previews in a total random pattern (again)
- loading a picture (tapping it) actually makes its preview appear again
- no problem at all on web side
Thanks @jesmrec for looking at this. Just to say that my experience is exactly the same as @Anycubic above. No issue on the server in terms of preview generation, and the first time you open a folder in the android app the previews all pop up fine (the speed that they appear seems fine to me). The issue arises when you open a folder in the app again subsequently. Sometimes the previews are still there, sometimes they're gone, and once they're gone it seems they don't come back unless you reinstall the app.
I started again from scratch. Uninstalled the app on Android, installed again. I opened "CameraUpload" folder where I have more than 2k photos and waited for all of the thumbnails to get loaded, eveything ok. I than opened another folder, thumbnails where not there and not being loaded. Went back to "CameraUpload" folder and thumbnails disappeared! I then stopped the app, re-opened it and CameraUpload folder was not showing a single thumbnail while other folders started to populate (the same folders which didn't show anything during the first run after reinstall cycle). The third time I opened the app also that folders which started to show thumbnails started to get "crazy" and showing not all of the previews (?). To wrap up:
uninstalling and reinstalling the app DOES something unfortunately the app starts to show and hide previews in a total random pattern (again) loading a picture (tapping it) actually makes its preview appear again no problem at all on web side
will check on that way, thanks again
Thanks @jesmrec for looking at this. Just to say that my experience is exactly the same as @Anycubic above. No issue on the server in terms of preview generation, and the first time you open a folder in the android app the previews all pop up fine (the speed that they appear seems fine to me). The issue arises when you open a folder in the app again subsequently. Sometimes the previews are still there, sometimes they're gone, and once they're gone it seems they don't come back unless you reinstall the app.
Thanks for the feedback, it's an strange issue, but there have to be something to fix.
Checking with your server, where i pushed a big amount of thumbnailed files (txt and images). Thumbnails loaded correctly. I will clarify how the thumbnails feature works:
@jesmrec I checked with images that you downloaded on my server and I can see the issue. Please have a look at the screenshot. The txt folder shows just a partial number of previews while on web client no issue at all. Testimages is ok. I guess there must be something in the Android app.
Thanks for adding, i did not reproduce in the initial attempts, i will do another check.
Well, i don't find a clear explanation about this problem. In fact, not easy to reproduce (kind of randomness). The point here would be going to the root, analyse the preview mechanism and check how to improve its performance, as far as we can (server is also involved).The only clear thing is that previews take longer as expected to preview when the amount of files is huge.
We could take a look about the local rendering as an improvement CC @Aitorbp @JuancaG05
Any other ideas are welcome.
As I said the issue is 100% present on both of my Android devices while I never reproduced it on any web interface (both Android and MacOS). I have thousands of pictures, I guess that this could be where to start
I have the exact same issue Android 13 Galaxy s20 Owncloud 10.15.2
Uninstalled the app several times, it loads thumbnails for images, close app open it again and several thumbnails in blocks are gone, randomly and the ones that are gone are also not generating again. Web works perfect.
Image shows cache of thumbnails on my phone
I notice half? Amount of files have a "-" before the name, maybe the naming starts with a negative number and proceeds towards a positive number? Or is there something else to it?
No new thumbnails, in the folder! "/Leon" where the thumbnails disappeared, since yesterday when i reinstalled the app and the last timestamp is when the generation of the thumbnails stopped working.
I open another folder (that i have not accessed since reinstall of mobile app) it starts generating thumbnails for that folder. I go back to /Leon, still no generation and thumbnails previously generated not showing (162 out of 190 not showing thumbnail of the image. File formats in folder .Jpg. Jpeg. Png, There is no consistency between file format / thumbnail not presenting)
/Leon is a shared folder with me as the owner and subfolders shared from other accounts ( im trying to see if i can replicate the same issue on folders that are not shared
Same issue is noted on non shared folders.
table oc_cache dump:
...
| 70247 | 5 | thumbnails/13986/360-360.png | 62fcb1382612ef82e8d6870ac86113cd | 64701 | 360-360.png | 8 | 3 | 124374 | 1745742394 | 1745742394 | 0 | 0 | b3f41cd281b14d5634b5b3355ec65236 | 27 | SHA1:d5d38c13367e03277a558f31883e75953aca1ef8 MD5:c3f84c2ae6d68458a11f31ec50f7a336 ADLER32:bd028612 |
| 70248 | 5 | thumbnails/13987/1080-1920-max.png | fd0456810bade2d68abe35bda50d10b5 | 64704 | 1080-1920-max.png | 8 | 3 | 1029082 | 1745742395 | 1745742395 | 0 | 0 | 187686b8d4ebae35a0c022a8bc19f078 | 27 | SHA1:c29e0610e327e66e8417a0c9c06d9d7278a3c717 MD5:a57955187b5aace62492b1593113569e ADLER32:642fb38c |
| 70249 | 5 | thumbnails/13987/360-360.png | 486eb0e99ae160f758a94196f1d69cb8 | 64704 | 360-360.png | 8 | 3 | 86706 | 1745742395 | 1745742395 | 0 | 0 | eaaa05cd11326ef1924ed976d4e401a4 | 27 | SHA1:003e033fe554c4386f6f674d430185bdd4e6c330 MD5:ed2150e00c9115e6eb15327f4b0f3006 ADLER32:aff5c920 |
| 70250 | 5 | thumbnails/13988/1080-1920-max.png | 577039c63cd791bafe06e5718a51bd1d | 64707 | 1080-1920-max.png | 8 | 3 | 1365876 | 1745742396 | 1745742396 | 0 | 0 | 27510a8a9311687d4353ff3056e7f0e3 | 27 | SHA1:9352a1daf6f409c2f400b63d6e312118e0d696a1 MD5:6f61bd80235819a0f5f010d913921457 ADLER32:ad191bcd |
| 70251 | 5 | thumbnails/13988/360-360.png | c1e34430d19adf68cfde346e4a864e59 | 64707 | 360-360.png | 8 | 3 | 75209 | 1745742396 | 1745742396 | 0 | 0 | 1e8c574d4ac9d22e3fca66f1ee33909d | 27 | SHA1:dea9ea69829c69d9573eb7ca80fb643af17c677d MD5:f666d02b21ebab7eb320b55e4b1f6b16 ADLER32:b300752f |
| 70252 | 5 | thumbnails/13989/1080-1920-max.png | 609a19998e8560f6bb4af7e22aabd4d9 | 64710 | 1080-1920-max.png | 8 | 3 | 1325543 | 1745742397 | 1745742397 | 0 | 0 | b4f26a3aec0a12573952621b9b6f43eb | 27 | SHA1:46e646e662f3b38bef5fe7b410308e0b66aa7403 MD5:bf8a538b4824677ab9993db90a4fbfce ADLER32:e4ffa5bb |
| 70253 | 5 | thumbnails/13989/360-360.png | 1f4c7380db5cf3156e17ae32cef46fcf | 64710 | 360-360.png | 8 | 3 | 72865 | 1745742397 | 1745742397 | 0 | 0 | bd8060831320895d601c9281c8567bbc | 27 | SHA1:0f65f64f4b338fbbb6ad4ec6175f12ac086835ba MD5:d67cd0ab3f8d66df355b10b79172de8a ADLER32:5e1ff12f |
| 70254 | 5 | thumbnails/13990/1080-1920-max.png | e4d881dabcfee82ae829c725ecf884a3 | 64713 | 1080-1920-max.png | 8 | 3 | 816757 | 1745742398 | 1745742398 | 0 | 0 | 1f24731658f7517ff50ab90e32498117 | 27 | SHA1:df87d159c83baeff30b8ee8d16cb3c8d890b6cef MD5:a5f57420fc84e01219fa268cb3c6a8e2 ADLER32:31236314 |
| 70255 | 5 | thumbnails/13990/360-360.png | 8783ff60451df23683dcb649fa32e378 | 64713 | 360-360.png | 8 | 3 | 55147 | 1745742398 | 1745742398 | 0 | 0 | 753cf7222ae577688353a5cbbccbd501 | 27 | SHA1:4b12427fa2d3f1a1f74df2a65eb58a75ab6b096c MD5:88344ed5dabf4d22f1a203158bd2e67a ADLER32:7956ce6e |
| 70256 | 5 | thumbnails/13991/1080-1920-max.png | 8b80ba1f8e54098b7bca16ce0d206d98 | 64716 | 1080-1920-max.png | 8 | 3 | 1509727 | 1745742399 | 1745742399 | 0 | 0 | 6ce98e5992f332593147d22cf3ba2d14 | 27 | SHA1:d05160363024e9b564dc076bf86f865e382b6873 MD5:aff669a6f686bdbc3ab86554cd6667b1 ADLER32:653417cb |
| 70257 | 5 | thumbnails/13991/360-360.png | 72d3890492eab883bd297645371d9915 | 64716 | 360-360.png | 8 | 3 | 86016 | 1745742399 | 1745742399 | 0 | 0 | 8f65dbb646082603403c3f8d966477b2 | 27 | SHA1:2a7b50fe55626d706673c66a5bd524934529ed38 MD5:9370246d023bf0780112e601a8c60ad6 ADLER32:ca68dd01 |
| 70258 | 5 | thumbnails/13992/1080-1920-max.png | bdfcb61737b83e7818029d4bf67f787e | 64719 | 1080-1920-max.png | 8 | 3 | 1629381 | 1745742401 | 1745742401 | 0 | 0 | 787ca378ae8ead077eca6a1ef5c753aa | 27 | SHA1:6388dcc2712d8a91ae55e7134dea088a91a8211d MD5:4c8172179472b65b40dbf094351da674 ADLER32:fcdbbd6e |
| 70259 | 5 | thumbnails/13992/360-360.png | 5fa381cd49fa33ba01c2d61c207b1af5 | 64719 | 360-360.png | 8 | 3 | 96043 | 1745742401 | 1745742401 | 0 | 0 | f57534b0da4bc11d79c33f2e7bc3f767 | 27 | SHA1:bb6c21c0d613683028fcad81575c8c69bb381d39 MD5:8f5293170d652e437d4a33db792c8b76 ADLER32:a016a67f |
| 70260 | 5 | thumbnails/13993/1080-1920-max.png | 03efb8b5c68554a4106bcc92a05a84a4 | 64722 | 1080-1920-max.png | 8 | 3 | 1604535 | 1745742402 | 1745742402 | 0 | 0 | 9a58f1e65e42adc26a5593f62ec2f1ad | 27 | SHA1:5e3fa9d909749b5be3e21c6efe552e0fed7db17f MD5:b5e474c30ec04f8ac3d45095602e5914 ADLER32:39ee974d |
| 70261 | 5 | thumbnails/13993/360-360.png | e6c7c3df22c839b01b339f720e2d67f1 | 64722 | 360-360.png | 8 | 3 | 96337 | 1745742402 | 1745742402 | 0 | 0 | c7fe68a064dcd6c41cdd1a51080403b4 | 27 | SHA1:be8d8163449c0304c2f2a11d685622b0614de234 MD5:ea49250bbbc0327a580d5733a3e9705e ADLER32:9b856308 |
| 70262 | 5 | thumbnails/56868/44-44.png | e6cd8005c7d6db7d2b599db47bf08db0 | 56869 | 44-44.png | 8 | 3 | 1059 | 1745743480 | 1745743480 | 0 | 0 | 5d64a37ed3bc56cf03338c1da8bc4744 | 27 | SHA1:b598ad999299dd6a72598e7078365c356928a745 MD5:4d6f6efc38369f686d6cfa910ccdfc94 ADLER32:77a898ca |
...
39511 rows in set (0.054 sec)
...
MariaDB [owncloud]> SELECT COUNT(*) FROM oc_file_locks;
+----------+
| COUNT(*) |
+----------+
| 0 |
+----------+
1 row in set (0.000 sec)
From com.owncloud.android /cache/thumbnailCache/journal.bin journal.txt "Dirty" (395 rows) "Remove" (145) "CLEAN" (688)
No images have been removed but it seems to somehow delete thumbnails?
I know zero about Android apps and code and there are several parts to reverse engineer, but it seems the DISK_CACHE_SIZE is limited to 10 MB
ThumbnailsRequester.kt:
private const val DISK_CACHE_SIZE: Long = 1024 * 1024 * 10 // 10MB
.diskCache {
DiskCache.Builder()
.directory(appContext.cacheDir.resolve("thumbnails_coil_cache"))
.maxSizeBytes(DISK_CACHE_SIZE)
.build()
}
DiskLruImageCache.java:
mDiskCache = DiskLruCache.open(
diskCacheDir, CACHE_VERSION, VALUE_COUNT, diskCacheSize
);
editor = mDiskCache.edit(validKey);
if (editor == null) {
return; // Cache is full or other editing is done
}
DiskLruCache algorithm and Coil seem to clean out the thumbnails from the phone.
From what i can see in my owncloud instance a thumbnail is +-18 000 bytes(6000-30000bytes) which with max 10 MB means that i can have not more than around 500-700 thumbnails on my phone.
A test i did: Navigated to /thumbnailCache on the phone and at the same time in owncloud navigate to a folder with many images (with no previously generated thumbnails in that folder) i can see in the cache files being removed while files also are being created at around a peak of 665 files as a maximum (6-30kb/thumbnails)
What about increasing the DISK_CACHE_SIZE to something much higher/not limiting it at all or let the user controll that parameter?
Also an issue here is that when the preview has been generated once and then deleted due to DISK_CACHE_SIZE limit, next time i visit the folder it does not download it from the server again. Fixing this maybe is not the best idea and i would as a user prefer to have all thumbnails already stored on my phone, than having to download them every time i visit a folder (Data usage/not possible to view already generated thumbnails while offline)
If im wrong or dont understand something please answer on which parts and i will try to dig deeper
I dont understand how this is not a bigger problem.
I changed DISK_CACHE_SIZE to 600mb in two files: ThumbnailsRequester.kt Thumbnailscachemanager.java
Built the app and installed it on my android phone and now its works like it should all my thumbnails not getting deleted after they are created.
As of now over 8000 thumbnails created
@julienn25 hi there! I can't believe the fix was so easy, could you please send your modified app to me? I'd like to see if it fixes my issues as well.
Thanks!
I dont understand how this is not a bigger problem.
I changed DISK_CACHE_SIZE to 600mb in two files: ThumbnailsRequester.kt Thumbnailscachemanager.java
Built the app and installed it on my android phone and now its works like it should all my thumbnails not getting deleted after they are created.
As of now over 8000 thumbnails created
https://drive.google.com/file/d/1-66S3s948JaQbJfFR177c-eJMTVm4IHk/view?usp=drive_link
Does this link work? Also, let me know if the APK and its thumbnails are functioning properly