Skip to content

Show all releases via in-app update#733

Merged
hjiangsu merged 3 commits into
thunder-app:developfrom
micahmo:fix/update-link
Sep 13, 2023
Merged

Show all releases via in-app update#733
hjiangsu merged 3 commits into
thunder-app:developfrom
micahmo:fix/update-link

Conversation

@micahmo

@micahmo micahmo commented Sep 13, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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

micahmo commented Sep 13, 2023

Copy link
Copy Markdown
Member Author

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

@hjiangsu

Copy link
Copy Markdown
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

micahmo commented Sep 13, 2023

Copy link
Copy Markdown
Member Author

Alrighty, let me know what you think now.

@hjiangsu hjiangsu left a comment

Copy link
Copy Markdown
Member

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
@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.

2 participants