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

The old client isn't going to be able to auto-update #2267

Closed
HebaruSan opened this issue Jan 29, 2018 · 3 comments
Closed

The old client isn't going to be able to auto-update #2267

HebaruSan opened this issue Jan 29, 2018 · 3 comments
Labels
AutoUpdate Issues affecting the automatic updating

Comments

@HebaruSan
Copy link
Member

Problem

CKAN 1.22.6 and earlier assume that ckan.exe is always the first asset in a release post when attempting to auto-update.

CKAN/Core/Net/AutoUpdate.cs

Lines 153 to 162 in f19213e

internal Tuple<Uri, long> RetrieveUrl(dynamic response)
{
if (response.assets.Count == 0)
{
throw new Kraken("The latest release isn't uploaded yet.");
}
var firstAsset = response.assets[0];
string url = firstAsset.browser_download_url.ToString();
return new Tuple<Uri, long>(new Uri(url), (long)firstAsset.size);
}

As of #2187, #2212, and #2225, we publish multiple assets, and ckan.exe is the third, after AutoUpdate.exe and CKAN.dmg. But an earlier release attempting to auto-update will download the first asset, which is AutoUpdate.exe, and run it instead of the newer ckan.exe. Obviously this is bad.

I tried editing the release to remove and re-add the assets in the correct order, and it didn't help; they reverted to the current ordering. GitHub seems to think that assets should always be in alphabetical order.

Since the released client assumes the file it needs will be assets[0], and we can't make that happen, we're in a bit of a bind.

Suggestions

After the next full release is published:

  1. Download all the assets other than ckan.exe
  2. Quickly edit the release
  3. Remove all assets other than ckan.exe
  4. Re-add the other assets as links in the release note text

For subsequent releases, #2266 fixes the first-asset assumption, so we should be able to publish them normally.

@HebaruSan HebaruSan added Bug Something is not working as intended AutoUpdate Issues affecting the automatic updating labels Jan 29, 2018
@politas
Copy link
Member

politas commented Jan 29, 2018

Well, that's annoying. Seems like a good suggestion, though it does mean that our 1.24.0 release is going to have to be solid enough to not require any quick patches. We'll have to wait for users to upgrade to that before replacing with an all - asset release

@HebaruSan
Copy link
Member Author

Another option might be to add a duplicate asset called "000_ckan.exe", which ought to sort to the top so the old client can find it. I haven't tested that out yet though...

@HebaruSan
Copy link
Member Author

No longer relevant, since the old client wasn't able to auto update at all anyway!

@HebaruSan HebaruSan removed the Bug Something is not working as intended label Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoUpdate Issues affecting the automatic updating
Projects
None yet
Development

No branches or pull requests

2 participants