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

Going to dependent crates then back makes the crate look like it depends on itself #306

Closed
troplin opened this issue Apr 8, 2016 · 4 comments

Comments

@troplin
Copy link

troplin commented Apr 8, 2016

  1. Go to the page of a crate that has some dependencies.
  2. Click on the link of one of the dependencies
  3. On the page of the dependecy, click on "dependent crates".
  4. Click on the link to the original crate again
  5. Look at the dependency links:
    • The dependency that we were following is now gone
    • The crate now seems to depend on itself
@tbu-
Copy link

tbu- commented Apr 30, 2016

This also happens with the back button:

  1. Go to a crate (e.g. itertools).
  2. Click a dependency (e.g. permutohedron).
  3. Click the back button in the browser.

Expected result: Crate page for itertools, listing permutohedron 0.1 as dependency.
Actual result: Crate page for itertools, listing itertools 0.1 as the only dependency.

Tested in Firefox 45.0.2 and Chromium 50.0.2661.75.

@carols10cents
Copy link
Member

Just tried this and this still happens. Not sure how to fix it though.

@carols10cents carols10cents changed the title Strange dependency confusion Going to dependent crates then back makes the crate look like it depends on itself Jun 17, 2017
@locks locks self-assigned this Jun 23, 2017
@locks
Copy link
Contributor

locks commented Jun 23, 2017

Back button works properly for me, but I still see the problem with OP's reproduction.

@Turbo87
Copy link
Member

Turbo87 commented Jun 23, 2017

the issue here is as follows:

when we visit /crates/itertools it will download the dependencies from /api/v1/crates/itertools/0.6.0/dependencies which includes:

{
  "crate_id":"either",
  "id":186109,
  "kind":"normal",
  "req":"^1.0",
  "target":null,
  "version_id":49566
}

when we click on the either dependency on the page it will request data from /api/v1/crates/either/reverse_dependencies which includes:

{
  "crate_id":"itertools",
  "id":186109,
  "kind":"normal",
  "optional":false,
  "req":"^1.0",
  "target":null,
  "version_id":49566
}

when we click the back button Ember Data will reuse the dependencies that it already downloaded for the itertools crate, and since the reverse_dependencies call overwrote the dependency:186109 record it will show itertools instead.

tl;dr it seems wrong that the API is returning a different crate_id content for the record depending on how it was queried (deps vs. reverse deps).

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

6 participants