Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

apm can't install a version that is more than [pagination limit] behind the latest #733

Open
1 task done
lee-dohm opened this issue Jul 24, 2017 · 2 comments · May be fixed by #773
Open
1 task done

apm can't install a version that is more than [pagination limit] behind the latest #733

lee-dohm opened this issue Jul 24, 2017 · 2 comments · May be fixed by #773

Comments

@lee-dohm
Copy link
Contributor

Prerequisites

Description

Running apm install autocomplete-python@1.8.11 results in an error even though the version is listed in the database.

Steps to Reproduce

  1. Open a terminal session
  2. Execute apm install autocomplete-python@1.8.11

Expected behavior: autocomplete-python v1.8.11 to be installed

Actual behavior: Package version: 1.8.11 not found error returned

Versions

Atom    : 1.20.0-dev-57e023e74
Electron: 1.6.9
Chrome  : 56.0.2924.87
Node    : 7.4.0
apm  1.18.3
npm  3.10.10
node 6.9.5 x64
python 2.7.13
git 2.13.3

Additional Information

I suspect this is because the results from the API aren't paginated.

@50Wliu
Copy link
Contributor

50Wliu commented Feb 7, 2018

The atom.io API doesn't have the ability to paginate, so this seems to be a problem with atom.io rather than apm. If it can paginate, then the documentation needs to be updated.

@50Wliu 50Wliu added the atom.io label Feb 7, 2018
@alangpierce
Copy link

Rather than relying on pagination, it looks like it should be possible to fall back to the endpoint for that specific version, e.g. https://atom.io/api/packages/autocomplete-python/versions/1.8.11

I'm working on a PR to do that, and should be able to put something up shortly.

alangpierce added a commit to alangpierce/apm that referenced this issue Feb 10, 2018
Fixes atom#733

Rather than relying only on the JSON returned for the package, we now fall back
to the `GET /api/packages/:package_name/versions/:version_name` endpoint if
necessary, and use the tarball URL from there if we find one.

Since I changed the code to use `version` to mean a version JSON object, I
renamed `packageVersion` to `versionName` in a few places to be more clear. I
also rely on `version.version` containing the version name, which required
updating some test fixtures.

This also adds tests for installing old versions in general and producing the
expected error message if a version isn't found.
@rsese rsese added the triaged label Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants