kiwix-android icon indicating copy to clipboard operation
kiwix-android copied to clipboard

[Bug ver 3.4.1]Infinite loading icon in library tab

Open Mitia99 opened this issue 3 years ago • 30 comments

Describe the bug Just an UI bug:Infinite loading icon in library tab No issue with the library,zims are loaded.

Expected behavior No more loading icon when zim are loaded.

Steps to reproduce the behavior:

  1. Download zim content
  2. Open library tab

Screenshots AddText_10-16-06.04.14.jpg

Environment

  • Version of Kiwix Android : 3.4.1
  • Device : Huawei P10
  • OS version : Android 9

Mitia99 avatar Oct 16 '20 15:10 Mitia99

Thank you for the report, will investigate and hopefully have a fix in not too long

macgills avatar Oct 19 '20 09:10 macgills

@Mitia99 I'm sorry but I can't reproduce the issue, I tried ~5 times the procedure mentioned in the description but couldn't find it. Can you please answer one question: Does it always occur(via following the steps given in the issue desc.) or you just caught it once?

s-ayush2903 avatar Oct 20 '20 17:10 s-ayush2903

@s-ayush2903 I tried force stop and clear cache but same issue.

Video showing the issue https://drive.google.com/file/d/1XKecR3z52jRgwCntXWLmA9xBakZZHoVB/view?usp=drivesdk

Mitia99 avatar Oct 20 '20 17:10 Mitia99

@s-ayush2903 It always occurs.

Additionnal information: I did an update from version 3.3.1(i.e I downloaded the zim contents with 3.3.1).

Mitia99 avatar Oct 21 '20 03:10 Mitia99

No worries, I'll take a look

s-ayush2903 avatar Oct 21 '20 03:10 s-ayush2903

@s-ayush2903 I tried to clear app data(which removed all zim contents) but same issue.So I don't think it that the issue is linked with the updateScreenshot_20201021_061917.jpg

Mitia99 avatar Oct 21 '20 03:10 Mitia99

Ahhh this is library, not Download, d'oh. So what this is doing is scanning your filesystem looking for zims. I am going to assume you are using an sd card? There is a possibility this is blocked by our file system detection, in Download do you see large entries ie >4GB, greyed out?

macgills avatar Oct 21 '20 08:10 macgills

@macgills I'm using a 64go SD Card.Storage is set on internal Screenshot_20201021_114225_org.kiwix.kiwixmobile.jpg

Mitia99 avatar Oct 21 '20 08:10 Mitia99

hmmmm so it is potentially an error in StorageObserver. Have you left the phone on this screen for an unreasonably long time? I wonder if it ever completes

macgills avatar Oct 21 '20 08:10 macgills

I'm encountering this problem too.

gouri-panda avatar Oct 21 '20 09:10 gouri-panda

Would you like for this to be assigned to you then @gouri-panda ? The file search completes near instantaneously on my device

macgills avatar Oct 21 '20 09:10 macgills

+1 To second line in the trailing comment, I still can't reproduce the issue

s-ayush2903 avatar Oct 21 '20 09:10 s-ayush2903

Would you like for this to be assigned to you then @gouri-panda ? The file search completes near instantaneously on my device

yes @macgills

gouri-panda avatar Oct 21 '20 09:10 gouri-panda

@Mitia99 I'm facing this problem but in a different way. On my phone, it loads for approximately 3-4 minutes. Do you have this situation too?

gouri-panda avatar Oct 21 '20 21:10 gouri-panda

@gouri-panda Yes same here,I figured out that it is taking ~ 2minutes but when I reduce kiwix app/switch to an other tab(e.g:download) and re-open kiwix/library tab,it is re-scanning very slowly.

Mitia99 avatar Oct 22 '20 03:10 Mitia99

That's because it is downloading the content even if you switched the tab, that's why it is taking so much time.

gouri-panda avatar Oct 22 '20 04:10 gouri-panda

@gouri-panda Oh,I see..I hope that you could improve the scan time.

Mitia99 avatar Oct 22 '20 05:10 Mitia99

@Mitia99 it's taking the usual time ,but if you have slow processor than you can feel the delay like I have. My one phone is taking 2 to 3 minutes and the other phone is taking hardly 10 sec.

gouri-panda avatar Oct 22 '20 05:10 gouri-panda

@gouri-panda I don't think that it is a processor issue.I am using a kirin 960(8 core cpu) which is pretty fast even in huge apps.Maybe,It will be better to limit the engine scan with only specific files/path(not the whole storage).

Mitia99 avatar Oct 22 '20 05:10 Mitia99

@Mitia99 I looked over your storage.My hypothesis is that you have a lot of content in both your internal and external memory card so thats why it scans the whole thing after you dowload zim files.

gouri-panda avatar Oct 22 '20 06:10 gouri-panda

@gouri-panda Yes,you're right.That's why making the engine to only scan specific folders/files types will be great.For users with large files in 128go/256go memory/SD Card it will take a very long time.

Mitia99 avatar Oct 22 '20 06:10 Mitia99

@Mitia99 It will break us our certain feature like sharing our Zim files and download the Zim files over the internet. It won't add these files into library.

gouri-panda avatar Oct 22 '20 07:10 gouri-panda

https://github.com/kiwix/kiwix-android/issues/2405 there is a solution outlined here

macgills avatar Oct 22 '20 08:10 macgills

@macgills Thank you for the reference.Personnaly,I don't really want a manual folder selection but only an improved auto-scan(modify a bit the way that the engine scans).

Mitia99 avatar Oct 22 '20 15:10 Mitia99

It is quite difficult to "intelligently" scan as any number of apps eg torrent clients, browsers, dedicated downloaders, could be downloading files and be putting them anywhere on disk as could a user transferring manually. Our only guarantee is to look everywhere and really it shouldn't be that slow but here we are. We have 2 options as I see it and we could do both of them.

  1. coroutines rewrite to try and improve performance
  2. a switch to deactivate full scanning and only look at Kiwix app folders

long term we could look at user configurable search locations but sooner or later we are going to have to start supporting the SAF which is going to change file access quite a lot and there is a lot of work that will go into UI/UX of that feature (unless we just give users a textbox and let them add any path they want but I imagine that being confusing and unfriendly) and that might get trashed, wasting dev time.

macgills avatar Oct 23 '20 08:10 macgills

@macgills Option 1 sounds good. Should I start working on this ticket?

gouri-panda avatar Nov 13 '20 11:11 gouri-panda

make a sub ticket for a coroutines rewrite would be best I think

macgills avatar Nov 13 '20 11:11 macgills

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] avatar Jan 14 '21 04:01 stale[bot]

@gouri-panda Not sure about the status of this bug, but switching to OPDS should solve the problem.

kelson42 avatar Apr 11 '21 12:04 kelson42

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] avatar Jun 11 '21 01:06 stale[bot]

Bug details update •Device: Huawei P30 (no sd card) •Memory usage : 90% of 128go •Android 10 •Kiwix: 3.6.0

Mitia99 avatar Aug 19 '22 15:08 Mitia99

@Mitia99 Thx for the update. It's really a pity you still suffer of it.

kelson42 avatar Aug 19 '22 16:08 kelson42

@kelson42 No problem. Btw, I noticed that rather than an infinite loading it is actually a slow library load.(My kiwix library size is about 700mo) Maybe it has something to do with my heavy memory usage (90% of 128go).

Mitia99 avatar Aug 19 '22 17:08 Mitia99