Skip to content
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

Articles containing "?" cannot be opened #2671

Closed
Inbefortus opened this issue Jul 3, 2021 · 31 comments
Closed

Articles containing "?" cannot be opened #2671

Inbefortus opened this issue Jul 3, 2021 · 31 comments
Assignees
Milestone

Comments

@Inbefortus
Copy link

Kiwix Version: 3.4.4
ZIM: 2021-03 German and English Wikipedia

Articles that contain a "?" cannot be opened. You can only open them by opening them in a new tab, as demonstrated in the videos below:

Screen_Recording_20210703-220205_Kiwix.mp4
Screen_Recording_20210703-223208_Kiwix.mp4
@ibrahim1520
Copy link

Hello !
Can I fix it?

@kelson42
Copy link
Collaborator

kelson42 commented Aug 8, 2021

@ibrahim1520 Yes, but first, what is your analysis of the problem? How would look like your solution?

@stale
Copy link

stale bot commented Jan 3, 2022

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 stale bot added the stale label Jan 3, 2022
@puranjayK
Copy link

Hi @kelson42 , I would like to work on this issue. However I'm a newbie here so could you guide me with this issue?

@stale stale bot removed the stale label Jan 18, 2022
@kelson42
Copy link
Collaborator

@puranjayK OK, but what isnthe root cause? How do you plan to fix the problem?

@puranjayK
Copy link

@puranjayK OK, but what isnthe root cause? How do you plan to fix the problem?

@kelson42 I'm a newbie, so i don't have much idea what about this. Could u guide me where I need to start from and if I should even take this issue?

@kelson42
Copy link
Collaborator

@puranjayK This is not a programming lesson here. Either you have a clue how to fix it and you take it and if you have technical questions we might then help. But you need to know first what you have to do. All the necessary information should be available in the README.md to start with.

@puranjayK
Copy link

@kelson42 I might have come out wrong but I wasn't asking for progamming lessons.
I meant I'm new to this org so can you help me from where I should begin for this issue?

@airpods69
Copy link

well I'd like to work on this issue
might take 2-3 days cause i still need to look at the source code (downloaded it and got graddle working but its kinda late here for now and i got some classes)

also its funny (Varenyam Bhardwaj here)

@airpods69
Copy link

airpods69 commented Jan 23, 2022

image
Seems like the "?" does something weird and messes up the URL for some reason
well atleast this is what i could tell from the logs

@airpods69
Copy link

also im so sorry @puranjayK I totally ignored the fact that you wanted to work on this issue!

@cdhiraj40
Copy link
Contributor

image Seems like the "?" does something weird and messes up the URL for some reason well atleast this is what i could tell from the logs

@airpods69 could you tell me where you got the article which had this ?so that I can reproduce and see if I get something :)

@airpods69
Copy link

image Seems like the "?" does something weird and messes up the URL for some reason well atleast this is what i could tell from the logs

@airpods69 could you tell me where you got the article which had this ?so that I can reproduce and see if I get something :)

found it in the wikipedia (the simplified english one i forgot the name ;-;)
search for rihana then scroll down and look for the loud album
open it and you should find the article with a "?" in it

@cdhiraj40
Copy link
Contributor

Thanks @airpods69 telling me the file name. @kelson42 seems like the content doesn't exist in the kiwix library itself so it can't find it which results in not opening the next article
for eg:
http://library.kiwix.org/wikipedia_en_simple_all_maxi_2022-01/A/What's_My_Name?
I don't think so if the issue is with our app

@airpods69
Copy link

maybe it is an issue with link if you ask me (just a hunch tbh)
image
but looking at the links it doesnt allow or even consider "?" while looking for it

and also i used the simplified wikipedia because it had a smaller download size
the person who opened the issue must have been using the complete version of wikipedia

@cdhiraj40
Copy link
Contributor

cdhiraj40 commented Jan 24, 2022

maybe it is an issue with a link if you ask me, but looking at the links it doesn't allow or even consider "?" while looking for it

you are correct but I have noticed many times that the link with the ? mark in end doesn't matter it will go to the same link
try: https://www.kiwix.org/en/support-us/code? https://www.primevideo.com?
put the whole URL including ? in end, you will see it redirects to the same page.

and also I used the simplified Wikipedia because it had a smaller download size the person who opened the issue must have been using the complete version of Wikipedia

I checked in complete version only that is https://download.kiwix.org/zim/wikipedia/wikipedia_en_simple_all_maxi_2022-01.zim

@airpods69
Copy link

airpods69 commented Jan 24, 2022

well no thats not the issue here

"whats my name?" does exist
instead of "?" it goes to %3F

so it doesnt exist cause its the wrong link which we are going to

replacing "?" with "%3F" should solve the issue while looking up for the link

we are looking for:
http://library.kiwix.org/wikipedia_en_simple_all_maxi_2022-01/A/What's_My_Name?

when we should be looking for:
http://library.kiwix.org/wikipedia_en_simple_all_maxi_2022-01/A/What's_My_Name%3F

so there you go the issue should be easy to solve just need to change how the link thingy works

@cdhiraj40
Copy link
Contributor

cdhiraj40 commented Jan 24, 2022

well no thats not the issue here

"whats my name?" does exist instead of "?" it goes to %3F

so it doesnt exist cause its the wrong link which we are going to

replacing "?" with "%3F" should solve the issue while looking up for the link

we are looking for: http://library.kiwix.org/wikipedia_en_simple_all_maxi_2022-01/A/What's_My_Name?

when we should be looking for: http://library.kiwix.org/wikipedia_en_simple_all_maxi_2022-01/A/What's_My_Name%3F

okay yeah, that does solve the thing, I thought the link didn't exist. Thanks for the info ;)

so there you go the issue should be easy to solve just need to change how the link thingy works

I think it has to change from the library itself?

@airpods69
Copy link

yep that seems to be the case for rihana but lemme just check with the german one

@airpods69
Copy link

actually that doesnt explain one thing

if it doesnt redirect then why does it work when the link is opened in a new tab
so that means its not a library issue right?

@airpods69
Copy link

I am not sure how libraries work but replacing "?" with "%3F" at all occurrences when loading the URL should fix it without changing everything in the library

@airpods69
Copy link

me and @cdhiraj40 discussed this but i thought putting it up here also would make sense so that everyone knows

IMG_20220124_153357~2.jpg

something interesting that i found

@Jaifroid
Copy link
Member

Hi all, this is an issue we also had in Kiwix JS. Please see kiwix/kiwix-js#806 and the PR that fixes it kiwix/kiwix-js#807. The issue is simply that the URL needs to have any querystrings and anchors removed BEFORE it is decoded.

A URL in a ZIM article is URI-encoded by default, but it may have additionally have a querystring, or an anchor (and that question mark and hash, if any, are not encoded). Usually a reader will have a function that removes any querysting and anchor before then decoding the URI and sending it to the backend for reading from the ZIM.

However, if the URI is decoded first and then querystrings are removed, then of course the question mark will be interpreted as a querystring and it and everything after will be removed.

You shouldn't substitute all question marks for %3F in the backend, or else you will introduce more problems than you solve! You should use a proper decodeURIComponent function after you have removed any querystring or hash anchor from the encoded URL in the article's HTML.

@bip7686
Copy link

bip7686 commented Mar 9, 2022

org.kiwix.kiwixmobile.core.main.CoreWebViewClient in line 143 the url "https://kiwix.app/A/What's_My_Name?" is not encoded. So that would mean that the url is decoded somewhere else? I was not able to find the place where the actual request is done.

@stale
Copy link

stale bot commented Jun 12, 2022

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 stale bot added the stale label Jun 12, 2022
@kelson42 kelson42 added this to the 3.7.0 milestone Jul 28, 2022
@stale stale bot removed the stale label Jul 28, 2022
@kelson42
Copy link
Collaborator

kelson42 commented Jul 28, 2022

@Inbefortus Maybe this bug is already fixed in 3.6.0, but otherwise we will fic it in 3.7.0.

@kelson42
Copy link
Collaborator

kelson42 commented Dec 1, 2022

@MohitMaliFtechiz Not a duplicate of #2847

@MohitMaliFtechiz
Copy link
Collaborator

MohitMaliFtechiz commented Dec 1, 2022

@MohitMaliFtechiz Not a duplicate of #2847

hi @kelson42 , Both Issue are different. since #2847 is related to new tab(webview is not giving proper url to handle) and #2671 is for article contains ? not opening in same tab. but i have placed a fix for both issues in #2968.

@kelson42 kelson42 modified the milestones: 3.7.0, 3.8.0 May 19, 2023
@MohitMaliFtechiz
Copy link
Collaborator

@kelson42, We already fixed this issue in #2968

@kelson42
Copy link
Collaborator

@Inbefortus I will close the ticket but woukd be glad to get your feedback to confirm this is fixed in 3.7.

@Inbefortus
Copy link
Author

@kelson42 Yes, I can confirm that this issue has been eliminated 👍

Screen_Recording_20230710-111040_One UI Home_1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants