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

Show all releases via in-app update #733

Merged
merged 3 commits into from
Sep 13, 2023

Conversation

micahmo
Copy link
Member

@micahmo micahmo commented Sep 13, 2023

Pull Request Description

This fixes the issue where pressing the in-app update prompt would only show the latest stable release instead of all releases.

Note that this technically opens a page with all of the releases, but the latest will be at the top. (There doesn't seem to be a way to directly link to the latest prerelease.)

Issue Being Fixed

In-all link was going to the latest stable release.

Issue Number: N/A

Screenshots / Recordings

Checklist

  • Did you update CHANGELOG.md?
  • Did you use localized strings where applicable?
  • Did you add semanticLabels where applicable for accessibility?

@hjiangsu
Copy link
Member

Hmm, I was thinking maybe we could obtain the url for the latest version that we found using GitHub's API.

In fetchVersion(), we use GitHub's API to fetch the list of all releases. It seems like we might be able to get the html URL for that given release as well!

e.g, https://api.github.com/repos/thunder-app/thunder/releases seems to contain html_url attribute in its response that we could potentially use!

@micahmo
Copy link
Member Author

micahmo commented Sep 13, 2023

Good point! Updated to use the API and get the specific latest release URL.

@hjiangsu
Copy link
Member

Just one suggestion here!

Since showUpdateNotification(BuildContext context, Version? version) gets passed in a Version object, I wonder if it might be better if we add an attribute to Version so that we can use that rather than to have to perform a separate query to fetch the URL

This way, we can both do the checks for updates, and also place the URL when we run fetchVersion(). I hope this makes sense (if not, just let me know and I can clarify)

For reference:

@micahmo
Copy link
Member Author

micahmo commented Sep 13, 2023

Alrighty, let me know what you think now.

Copy link
Member

@hjiangsu hjiangsu left a comment

Choose a reason for hiding this comment

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

LGTM!

@hjiangsu hjiangsu merged commit 31a675e into thunder-app:develop Sep 13, 2023
1 check passed
@micahmo micahmo deleted the fix/update-link branch September 14, 2023 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants