Page MenuHomePhabricator

[electron-update-server] Ignore older releases
ClosedPublic

Authored by michal on Jun 14 2023, 6:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 27, 7:06 PM
Unknown Object (File)
Thu, Jun 27, 2:01 PM
Unknown Object (File)
Thu, Jun 27, 4:24 AM
Unknown Object (File)
Wed, Jun 26, 3:52 PM
Unknown Object (File)
Wed, Jun 26, 3:39 PM
Unknown Object (File)
Mon, Jun 24, 4:33 AM
Unknown Object (File)
May 29 2024, 3:28 AM
Unknown Object (File)
May 29 2024, 3:28 AM
Subscribers

Details

Summary

Fix for https://linear.app/comm/issue/ENG-4073
hazel (the update server for electron) has these issues:

  • it depends on the ordering of releases returned by GitHub API, which isn't guaranteed
  • it only checks if the new version from GitHub is different than the currently cached version

This diffs adds sorting of the results from github and checks if the new release is (semver) greater than the currently cached.

Test Plan

Check with a test repo:

  • add a new release, check if it's cached
  • add a new release that has a lower semver, check that it's skipped

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil requested changes to this revision.Jun 15 2023, 3:11 AM
kamil added inline comments.
patches/hazel-server+5.1.1.patch
17–27 ↗(On Diff #27754)

can be simplified

31–35 ↗(On Diff #27754)

Correct me if I am wrong but looks like we can modify this condition here and avoid sorting, since at the end we care only about the latest version

This revision now requires changes to proceed.Jun 15 2023, 3:11 AM

Moved all conditions (version has to be newer, release has to have assets) to the find condition instead of skipping them after one release is chosen. This way we don't ignore the rest of release from github api

This revision is now accepted and ready to land.Jun 16 2023, 2:38 AM