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

fix: fix updater #1407

Merged
merged 9 commits into from
Apr 5, 2024
Merged

fix: fix updater #1407

merged 9 commits into from
Apr 5, 2024

Conversation

eglitise
Copy link
Collaborator

@eglitise eglitise commented Apr 3, 2024

This PR fixes the long-outstanding issue with the updater not working. It reverts from the custom implementation based on the stock Electron updater, to a simpler version based on electron-updater.

For now the implementation only works through the manual 'Check for Updates' button, but it should not be too difficult to also add automatic checking in the future, once it's certain that the manual approach works fine.

Most of the code related to the old updater implementation has also been removed.

I did also test this functionality. This was done by changing the application version in package.json to a smaller number, packaging it into an installer, installing it, and then checking for updates. On macOS I ran into an error when clicking restart after the 'newer' version was downloaded - I believe this is likely due to different code signing identities. On Windows the process worked fine, although there was an odd ENOENT warning upon launching the updated version, which did not appear upon reopening the app - maybe related to different publish options.

Despite the above problems, I think the change is still an improvement and is worth merging in its current state. Perhaps the issues will disappear when updating between two production versions.

Fixes #733.

@github-actions github-actions bot added dependencies Dependency updates, removals or additions documentation Improvements or additions to documentation fix This resolves a user-facing problem i18n Translation changes labels Apr 3, 2024
type: 'info',
message: t('appiumIsAvailable', {name: version}),
buttons: [t('Install Now'), t('Install Later')],
detail: t('updateDetails', {pubDate, notes: RELEASES_LINK}),
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be possible to show release notes for the particular version?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did investigate this option, but decided against it for several reasons:

  • The raw release notes string requires post-processing to make it readable (remove HTML tags with regex, handle multi-level bullet points, etc)
  • The release notes can get quite large and cause the floating box buttons to go out of bounds, preventing any user interaction. I mainly observed this with the raw release notes string, but there is still a possibility that it can apply to the post-processed notes in the future. A quick search for scrolling options inside this box also didn't give me any results.
  • The user may skip one or more versions during the update, and showing the changelog only for the most recent version is not sufficient, in my opinion

Still, the floating box does have another problem - it cannot render clickable links, so the link shown here is unfortunately just text.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not very useful if it is just a text.
Anyway, I believe we could still show release notes nicely either by creating a HTML view or just using something link html-to-text to render it as a text and have scrolling there. Not for this PR though

@eglitise eglitise merged commit 9100b2d into appium:main Apr 5, 2024
7 checks passed
@eglitise eglitise deleted the fix-auto-updater branch April 5, 2024 13:38
Copy link
Member

@jlipps jlipps left a comment

Choose a reason for hiding this comment

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

Incredible fix for this issue, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Dependency updates, removals or additions documentation Improvements or additions to documentation fix This resolves a user-facing problem i18n Translation changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating Appium inspector with app is not working
3 participants