-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
[BUG] Renamed packages should redirect to the new name #268
Comments
I didn't even know you could rename packages until I started contributing to Pulsar, so I had no idea whether the feature had been properly implemented back in the Atom days. Since NPM doesn't have the ability to rename packages, I was skeptical that Pulsar and PPM had managed to handle this seamlessly. So I did some digging. Here's what I found. (Keep in mind that most of this is hypothetical, and can’t actually be tested until we fix how the
This was a rollercoaster — I spent at least half an hour writing this where I was convinced that this flow wouldn’t work, but then I read the code more closely. I think the takeaway is this:
Honestly, though, the first item is the crucial one; once that logic fix is deployed, we can run real-world experiments about this stuff and act accordingly. |
Fantastic write up here. Since we return another call this could follow infinite changes no matter how many times a package's name is changed, and ensures it will always return the most up to date package name, which then can be returned via the API. While the method outlined above isn't the best for SEO, since like you said that should be a 301 redirect, this could get things working rather quickly, and sometime later we look into a proper redirect. But a redirect could likely be accomplished with an check of the name being returned having matched the name request by the user and redirecting. Which actually sounds incredibly easy, but does require both implementations. I'll try to take a shot at this one later today if I find the time |
I opened #269 yesterday to improve the testing situation around package renaming and make it better resemble real-world renaming scenarios. Here's a rough checklist of how to proceed:
|
(Couldn't decide between “feature” and “bug,” so I flipped a coin.)
What is the Bug
We support the renaming of a package, but this only seems to point the GitHub repo to a new name. It effectively “orphans” the old name and its subscribers.
Instead, the old name should function as an “alias” for the new name. Consider a package renamed from
old-name
tonew-name
; when Pulsar checks what the latest version ofold-name
is, it should get the same result as if it had asked what the newest version ofnew-name
is. The package “card” in Pulsar can show the new name, but otherwise nothing else would have to change about the repo on the user's machine; it could still exist at~/.pulsar/packages/old-name
without any problem.I'm pretty sure this would be seamless. An edge case would be if the user explicitly searched for
new-name
; ideally they'd get thenew-name
result and Pulsar would know that it was already installed.How to Replicate the Bug
Check out these search results. They reflect both the original name of a package and what I renamed it to.
The text was updated successfully, but these errors were encountered: