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

Revisions compared as string / PHP docset outdated #1532

Closed
cweiske opened this issue Sep 7, 2023 · 4 comments
Closed

Revisions compared as string / PHP docset outdated #1532

cweiske opened this issue Sep 7, 2023 · 4 comments

Comments

@cweiske
Copy link

cweiske commented Sep 7, 2023

The current PHP manual date is 2020-01-05, which is 3 years old.
PHP 8 happened since then, and many classes and functions are not available in the dash docset.

Please update this docset.

(Dash author said that this is a zeal issue: Kapeli/Dash-User-Contributions#4565)

@cweiske
Copy link
Author

cweiske commented Sep 7, 2023

docsetsdialog.cpp downloads the list of docsets from https://api.zealdocs.org/v1/docsets
It has PHP with revision 121, my local revision is 79:

$ cat ~/.local/share/Zeal/Zeal/docsets/PHP.docset/meta.json 
{
    "name": "PHP",
    "revision": "79",
    "title": "PHP"
}

DocsetsDialog::processDocsetList looks like as it should notice that.


I moved the PHP.docset directory away and re-installed the PHP docset. I now have the latest version.

So this seems to be a bug in update handling.
I'm using Zeal 0.6.1 from Ubuntu 22.04.

@cweiske
Copy link
Author

cweiske commented Sep 7, 2023

I found it:
The latest PHP revision is 121, but my local one is 79.
When I change the local revision to 100, Zeal shows that an update is available.
When the local revision number is between 13 and 99, an update is never shown to be available.

@cweiske
Copy link
Author

cweiske commented Sep 7, 2023

And all this because DocsetMetadata revisions are strings, and a string comparison of 13 and 121 of course says that 13 is higher.

@cweiske cweiske changed the title PHP docset outdated Revisions compared as string / PHP docset outdated Sep 7, 2023
@trollixx
Copy link
Member

trollixx commented Sep 8, 2023

Thanks for reporting and investigating! Just pushed a bit hacky fix.

Unfortunately, there's no backwards compatible way to fix this on the API side without resorting to prepending zeros to the revision number. It's something to address in future version of the docset list.

@trollixx trollixx added this to the 0.7.0 milestone Sep 8, 2023
trollixx added a commit that referenced this issue Oct 7, 2023
Regression introduced in a fix for #1532.

Fixes #1559.
@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants