-
-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed Zimit archives are not displaying correctly. #3580
Conversation
@MohitMaliFtechiz From your video it looks like this fixes it! I'm afraid I don't have the setup to build the Android app, so I can only test an APK, if that would be useful. Otherwise, since the before was the same as my before, and the after looks most definitely fixed, I'd say this fixes it. |
@Jaifroid You can download the apk from here https://drive.google.com/file/d/1-aAAdSxrwITj9tfTU-eFJ17faY0tyaOK/view?usp=drivesdk and test the other zimit file also with those zim files that are reported. |
@MohitMaliFtechiz I've tested that APK on my midrange Android, and as far as I can tell it's all working fine. I tested four or five different Zimit-based ZIMs, and they're all displaying as expected. Unrelated to the issue at hand, I got notified about some leak traces. Do you want more info, or are you already aware of these? |
1e48c8a
to
b391621
Compare
@kelson42 @mgautierfr, While testing this fix with other zim files I have a bug with libkiwix. Sometimes it shows infinitely loading and sometimes it shows Entrynotshowing.mp4Addingundefinedintheurl.mp4Whenever this bug occurs the logs show a
@mgautierfr is there any condition in the libkiwix code where it adds the The bug exists with this PR code and without this PR code. @kelson42 Apart from this issue, i have found all the zim files working correctly with this PR change. |
@Jaifroid Thanks for testing and your confirmation.
@Jaifroid We had implemented the detection of memory leak in our CI, if any memory leak is detected then the CI will fail. These memory leaks you are facing are device-specific as I also get these logs in Samsung device(Android 12) but there is no memory leak reported when I run the application on the Pixel 7a(Android 13) and on the Redmi Note 9(Android 12). |
@MohitMaliFtechiz The infinitely loading bug (the circle at the top of the screen just going round and round) is a sign that the Replay system hasn't loaded correctly, and we're just displaying This issue also occurs with pages served via Kiwix Serve, so I'm not sure it's specific to Android. What should happen is that index.html has a script attached called The spinner you see is just a gif or something similar. It's not an indicator of any activity.
|
@Jaifroid Thanks for details.
@Jaifroid Yes, you are right, it is 60-40 I have tried 10 times, and 6 times it loads the page, and 4 times it fails to load the page.
Ohh so it means this issue is not Android specific. How are we handling this situation on the |
It's not currently handled in Kiwix Serve, and I don't think it can be, as it's just a server that know how to read ZIM URLs. It may be an issue with the Replay backend. @ikreymer already squashed one such bug here: openzim/zimit#154, but it seems like this might be another. I mean, the Android player probably could handle this with some checks, just as I've had to handle it in the backend of Kiwix JS browser extension now that it has full Replay support. But in Kiwix JS the loading sequence is different, because we can't register the Replay Service worker for each ZIM, instead, we register it as a Worker that communicates with our overall Service Worker, and just change the Collection when a different ZIM request is made (this way I support multiple ZIMs being open at once, with only one Service Worker). In any case, it means that I can wait for the Replay Worker to be ready before looking for That architecture is different from the Kiwix Serve and Android implementations, which rely on registering the Service Worker provided in the ZIM each time a new ZIM is loaded. The async functions in EDIT: Thinking about it, the most likely failure point is that |
@Jaifroid In Android we are not handling the extraction or registration ourselves, we have the kiwix-android/core/src/main/java/org/kiwix/kiwixmobile/core/ServiceWorkerInitialiser.kt Line 32 in 64582cf
High probability of this because sometimes it works and sometimes not. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #3580 +/- ##
=============================================
+ Coverage 48.87% 48.97% +0.09%
+ Complexity 1094 1086 -8
=============================================
Files 285 285
Lines 10535 10496 -39
Branches 1411 1404 -7
=============================================
- Hits 5149 5140 -9
+ Misses 4549 4525 -24
+ Partials 837 831 -6 ☔ View full report in Codecov by Sentry. |
In the libkiwix/libzim not. But in some js code which have a undefined value which is added to the url when composing the path ? yes.
What issue exactly you want me to confirm ?
It make me think about openzim/warc2zim#109 |
@mgautierfr When this |
Is suspect it is added by the service worker code (in the zim file itself) or something like that. It may be because the service worker in wrongly "initialized". I don't know the cause but it may be related to the issue with |
@mgautierfr Thanks, it seems the Since this PR purpose is to correctly display Zimit archives that have been fixed. |
https://github.com/openzim/warc2zim is probably the right repository. |
@mgautierfr I have open a ticket for this in the |
b391621
to
bdd41bf
Compare
@MohitMaliFtechiz What is the status here? We have a bug in both |
@kelson42 To be honest, I am not very sure here but I have analyzed the behavior this error comes when "ww init" calls twice in [INFO:CONSOLE(17)] "ww init", source: https://kiwix.app/A/sw.js (17)
2023-12-14 14:30:31.531 18592-18592 chromium org.kiwix.kiwixmobile I [INFO:CONSOLE(9)] "Uncaught TypeError: t.waitUntil is not a function", source: https://kiwix.app/A/sw.js (9)
2023-12-14 14:30:31.532 18592-18592 chromium org.kiwix.kiwixmobile I [INFO:CONSOLE(9)] "Uncaught TypeError: t.waitUntil is not a function", source: https://kiwix.app/A/sw.js (9)
2023-12-14 14:30:31.543 18592-18592 chromium org.kiwix.kiwixmobile I [INFO:CONSOLE(17)] "ww init", source: https://kiwix.app/A/sw.js (17)
2023-12-14 14:30:31.545 18592-18592 chromium org.kiwix.kiwixmobile I [INFO:CONSOLE(9)] "Uncaught TypeError: t.waitUntil is not a function", source: https://kiwix.app/A/sw.js (9)
2023-12-14 14:30:31.547 18592-18592 chromium org.kiwix.kiwixmobile I [INFO:CONSOLE(9)] "Uncaught TypeError: t.waitUntil is not a function", source: https://kiwix.app/A/sw.js (9)
2023-12-14 14:30:31.566 18592-18592 chromium org.kiwix.kiwixmobile I [INFO:CONSOLE(42)] "final: https://kiwix.app/A/journals.openedition.org/bibnum/", source: https://kiwix.app/A/load.js (42)
2023-12-14 14:30:31.574 18592-18592 chromium org.kiwix.kiwixmobile I [INFO:CONSOLE(9)] "[object DOMException]", source: https://kiwix.app/A/sw.js (9) |
76fb979
to
21caee9
Compare
* The getEntryByPath method was being called twice when retrieving content. Consequently, the initial call returned the content entry URL with additional parameters. Subsequently, when making the second call with the provided URL, it resulted in an "entry not found" exception. This issue prevented the loading of the CSS and content of the Zim file. * Additionally, the getActualUrl method was primarily implemented to retrieve the redirect entry of the URL provided by the webView. It is unnecessary to invoke this method when obtaining content.
Fixes #3578
Before fix
withdualmethodcall.mp4
After fixing
Afterfix.mp4