Pub-dev: Several recent analyzer doc links redirect to "latest"

Created on 11 Sep 2019  路  13Comments  路  Source: dart-lang/pub-dev

The documentation failed to generate for analyzer 0.38.2:

https://pub.dev/packages/analyzer/versions

So let's click the link for 0.38.1: https://pub.dev/documentation/analyzer/0.38.1/ - this redirects to latest, showing "Pub site failed to generate dartdoc for this package.".

Same for:

https://pub.dev/documentation/analyzer/0.37.0/ works fine; no redirect.

package docs bug

All 13 comments

mockito 4.1.2 was recently published, but dartdoc failed to generate docs (see https://github.com/dart-lang/mockito/issues/273). However, trying to access the old mockito 4.1.1 documentation redirects to https://pub.dev/documentation/mockito/latest/, which presumably tries to access the non-existent 4.1.2 documentation. Currently there does not seem to be any way to access mockito API documentation through pub.dev.

Thanks for reporting, I'll investigate. On a cursory look, the latest stable of mockito depends on non-stable SDK, and docs won't get generated on pub with that. Not sure why the 4.1.1 redirects, will need to check the code.

The root cause of the redirect is a cached DartdocEntry for 4.1.1, which contains that it is the latest stable version (it was at the time the cache entry was built), and it is not accessed on the /latest/ URL. The cache entry has a TTL of 24 hours, it should expire soon, and after that the 4.1.1 link should be available.

To fix that, we should either remove the extra check for the /latest/ redirect or do an extra check if the version is still the latest.

When a new package version is uploaded, could we perhaps invalidate the cache entry for the previously latest stable version?

When a new package version is uploaded, could we perhaps invalidate the cache entry for the previously latest stable version?

We do that on successful dartdoc content generation - otherwise a fresh upload may not have the required dartdoc content yet.

It sounds like there's an inconsistency in that the cached entry is invalidated only upon successful dartdoc generation, but /latest/ no longer points to the old documentation even if dartdoc fails?

It's been more than 24 hours, but https://pub.dev/documentation/mockito/4.1.1/ still seems to be going to /latest/.

Did some investigation, and found another source of the flag, unrelated to the 24-hour caching: when our DartdocEntry object originates from an earlier runtimeVersion of the site (because the current did not complete the doc generation yet), it can still have the isLatestStable flag set, because at-the-time of the document generation it was the latest.

Removing the forced-redirect rule should handle this too. (It will raise the concern of the canonical-url that we put in the generated docs, but Google SEO is secondary to serving the actual HTML content.)

Any idea when https://pub.dev/documentation/mockito/4.1.1/ will stop redirecting to /latest/?

@jamesderlin: #3974 has (hopefully) fixed the issue in the code. We are in the process of rolling out a new pub.dev release. Once the release is finalized and the traffic is migrated, 4.1.1 will render the documentation as expected.

This is now fixed. If you experience anything similar, please open a new issue.

Thank you thank you thank you, @isoos !

Was this page helpful?
0 / 5 - 0 ratings