Skip to content

Make available on Windows, revert previous changes #20136

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sebdanielsson
Copy link
Contributor

Description

  • Undo previous changes that broke unshortening for some URLs. For example t.co links.
  • Make extension available to Windows users.
  • Bump dependencies.

Screencast

No visual changes.

Checklist

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: url-unshortener Issues related to the url-unshortener extension OP is author The OP of the PR is the author of the extension labels Jun 30, 2025
@raycastbot
Copy link
Collaborator

Thank you for the update! 🎉

You can expect an initial review within five business days.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Major update to the URL Unshortener extension making it Windows-compatible and fixing URL unshortening functionality for services like t.co.

  • The CHANGELOG.md entry needs the required {PR_MERGE_DATE} template string in its title
  • Major version bump of @raycast/api from ^1.62.2 to ~1.100.3 in extensions/url-unshortener/package.json
  • Simplified URL unshortening logic in extensions/url-unshortener/src/utils.tsx by removing complex retry mechanisms
  • Added Windows platform support while maintaining macOS compatibility

3 files reviewed, 3 comments
Edit PR Review Bot Settings | Greptile


while (redirectCount < maxRedirects) {
while (response.url) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: response.url will always be defined as we're passing a URL. Use a counter or check response.headers.get('location') to control the loop

Suggested change
while (response.url) {
while (response.status >= 300 && response.status < 400) {

} catch (redirectError) {
break;
}
response = await fetch(nextUrl, { method: "HEAD", redirect: "manual" });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Use new URL(nextUrl, url).toString() to handle relative redirect URLs

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension fix / improvement Label for PRs with extension's fix improvements extension: url-unshortener Issues related to the url-unshortener extension OP is author The OP of the PR is the author of the extension Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants