Skip to content

Allow package hosts to sync versions on-demand

Administrator requested to merge olafurpg/lazy-crate-syncing into main

Created by: olafurpg

Previously, the /compare page failed to load the diff if one of the versions was not tracked in our database. This commit fixes that issue by allowing the package host to lazily sync the requested versions (for the diff). The fix is generic so this lazy syncing logic works in other pages like the blob view if the user manually types the revision in the URL.

Video explaining the motivation for this change in more details https://www.loom.com/share/4c77315ce34a4d7bb59b91ff08f7a4c7

Test plan

See newly added test cases that demonstrate lazy version fetching.

Merge request reports

Loading