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

Failed to import custom slug from Bitly. #2095

Closed
TokuiNico opened this issue Apr 12, 2024 · 5 comments · Fixed by #2097
Closed

Failed to import custom slug from Bitly. #2095

TokuiNico opened this issue Apr 12, 2024 · 5 comments · Fixed by #2097
Labels
Milestone

Comments

@TokuiNico
Copy link

Shlink version

3.7.3

PHP version

8.2.13

How do you serve Shlink

Docker image

Database engine

MySQL

Database version

8.0.32

Current behavior

I imported short links from Bitly and noticed that the short links with a custom slug (e.g., https://www.custom.com/custom_slug) were skipped, while the short links with just a custom domain were successfully imported (e.g., https://www.custom.com/random_slug).

Expected behavior

Import all short links, whether they have custom slugs or not.

Minimum steps to reproduce

  1. Generate two Bitly short links: one with a custom domain and the other with a custom domain and slug.
  2. Import short links using Shlink CLI.
@TokuiNico TokuiNico added the bug label Apr 12, 2024
@TokuiNico TokuiNico changed the title Import custom slug from bitly failed Failed to import custom slug from Bitly. Apr 12, 2024
@acelaya acelaya moved this to Todo in Shlink Apr 12, 2024
@acelaya acelaya added this to the 4.1.0 milestone Apr 12, 2024
@acelaya
Copy link
Member

acelaya commented Apr 12, 2024

I can see there's a bug in the logic when reading custom slugs, because bitly seems to be still generating a random short code under the hood, and its API returns the custom slug in a different field.

However, this should not make the links to be skipped, but to be imported with that random short code instead of their custom slug (this is what I experienced while testing this).

Can you confirm what's the exact behavior you are experiencing? Did you explicitly see the "Skipped" keyword in the console for those, or did they get imported with an "unknown" random slug/short code?

@TokuiNico
Copy link
Author

TokuiNico commented Apr 12, 2024

Thank you for your rapid assistance. I checked the shlink database and did find short URLs using random short codes.

I expected that in this situation, shlink would use a custom slug instead of the random code generated by bitly, or provide an option for me to decide which slug to use. This way, I can fully migrate my bitly short URL service to shlink.

@acelaya
Copy link
Member

acelaya commented Apr 12, 2024

I expected that in this situation, shlink would use a custom slug instead of the random code generated by bitly

Yes, that's the intended behavior. I'll get that fixed.

@acelaya acelaya moved this from Todo to In Progress in Shlink Apr 12, 2024
@acelaya acelaya moved this from In Progress to In review in Shlink Apr 12, 2024
@github-project-automation github-project-automation bot moved this from In review to Done in Shlink Apr 12, 2024
@acelaya
Copy link
Member

acelaya commented Apr 14, 2024

Shlink 4.1.0 has just been released, which includes this fix.

@TokuiNico
Copy link
Author

Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants