FKAMP-8: Scripts won't update from Github



Issue Information

Issue Type: Bug
 
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: Anti-AMP Scripts (FKAMP)
Resolution: Fixed (2019-06-13 16:56:11)
Affects Version: V1.1, v1.2, v1.3, v1.4, v1.4.1, v1.4.21, v1.4.3,
Target version: V1.5,

Created: 2019-06-13 16:10:06
Time Spent Working


Description
I released V1.4.3 yesterday

However, when I went into Greasemonkey and hit "Update Now", Greasemonkey reported No Newer Version available. This happened on phone, tablet and laptop.

The script stayed at version 1.4.21 and I had to go directly to raw.github for each of the scripts and hit Install for it to update (and it did update rather than installing a new version).

Googling's not yielded anyone complaining about this, so there are a couple of possibilities

- I've screwed up the downloadURL line somehow
- It genuinely doesn't work with scripts hosted on Github

If it's the latter, then will need to look at re-hosting via my CDN (which is fine), but I'd also like to get to the bottom of just why that is.


Toggle State Changes

Activity


OK, to test this I've created a userscript on Github - https://github.com/bentasker/testproject/blob/master/test_fkamp_8.user.js

- add this into Greasemonkey,
- bump the version, commit
- try and update (to verify that Greasemonkey states no update is available).
- Then I'll install by browsing to it and verifying it increases.

That should be a repro of the issue.

Then, I'll
- deploy a slightly modified version of it (i.e. change the name and download URL) to my servers
- install via my CDN
- Bump the version number
- Flush CDN cache
- Check for updates

Repo: testproject
Commit: 26ccc6c4e38fb588fff3a0dfcd138cfbef0e9089
Author: B Tasker <github@<Domain Hidden>>

Date: Thu Jun 13 16:19:50 2019 +0100
Commit Message: Bump version number for FKAMP-8



Modified (-)(+)
-------
test_fkamp_8.user.js




Webhook User-Agent

GitHub-Hookshot/040b707


View Commit

Version bumped, verified in my browser desktop that the new version string appeared in the meta.

Checked for update on my Phone (Greasemonkey -> Test script for FKAMP-8 -> User Script Options -> Update Now) and got No newer version available
Ok, published a second script, this time via my CDN
ben@milleniumfalcon:~$ curl https://static1.bentasker.co.uk/misc/test_2_fkamp_8.user.js
// ==UserScript==
// @name           Test script 2 for FKAMP-8
// @namespace      http
// @description    Used to test whether updates work via Github
// @include        *://*google*/search*
// @include        *://news.google*/*
// @run-at document-end
// @grant none
// @downloadURL https://static1.bentasker.co.uk/misc/test_2_fkamp_8.user.js
// @version 1.4.21
//
//
// See https://projects.bentasker.co.uk/jira_projects/browse/FKAMP-8.html
//
// Author: B Tasker
// ==/UserScript==


console.log("Loaded");
Browsing to that URL led to Greasemonkey prompting me to install, so now have 1.4.21 on my phone.

Bumping version number and flushing CDN cache.
ben@milleniumfalcon:/tmp/testproject$ curl https://static1.bentasker.co.uk/misc/test_2_fkamp_8.user.js
// ==UserScript==
// @name           Test script 2 for FKAMP-8
// @namespace      http
// @description    Used to test whether updates work via Github
// @include        *://*google*/search*
// @include        *://news.google*/*
// @run-at document-end
// @grant none
// @downloadURL https://static1.bentasker.co.uk/misc/test_2_fkamp_8.user.js
// @version 1.4.3
//
//
// See https://projects.bentasker.co.uk/jira_projects/browse/FKAMP-8.html
//
// Author: B Tasker
// ==/UserScript==


console.log("Loaded");


Checked for update on phone, same result.

Looking in the HTTP access logs, looks like it's just a standard GET (had wondered if there was something going on with conditional requests).
86.138.218.68	-	-	[13/Jun/2019:15:29:59 +0000]	"GET /misc/test_2_fkamp_8.user.js HTTP/2.0"	200	321	"-"	"Mozilla/5.0 (Android 8.0.0; Mobile; rv:67.0) Gecko/67.0 Firefox/67.0"	"-"	"static1.bentasker.co.uk"	CACHE_MISS	0.034	mikasa	-

Ok, bumped the number a bit more
ben@milleniumfalcon:/tmp/testproject$ curl https://static1.bentasker.co.uk/misc/test_2_fkamp_8.user.js
// ==UserScript==
// @name           Test script 2 for FKAMP-8
// @namespace      http
// @description    Used to test whether updates work via Github
// @include        *://*google*/search*
// @include        *://news.google*/*
// @run-at document-end
// @grant none
// @downloadURL https://static1.bentasker.co.uk/misc/test_2_fkamp_8.user.js
// @version 1.5.3
//
//
// See https://projects.bentasker.co.uk/jira_projects/browse/FKAMP-8.html
//
// Author: B Tasker
// ==/UserScript==


console.log("Loaded");



And it updates successfully. Lets repeat that on Github quickly... Didn't work, still get No Newer Version available

Repo: testproject
Commit: 7c012b560e69dac4204e59de1e233bdebc7442e0
Author: B Tasker <github@<Domain Hidden>>

Date: Thu Jun 13 16:32:42 2019 +0100
Commit Message: FKAMP-8 Increment minor number



Modified (-)(+)
-------
test_fkamp_8.user.js




Webhook User-Agent

GitHub-Hookshot/040b707


View Commit

So, at least with the CDN fetch, it seems as though Greasemonkey only pays attention to the first two numbers in the version string (although the Toolkit version format - https://developer.mozilla.org/en-US/docs/Mozilla/Toolkit_version_format - that you're supposed to use - https://github.com/scriptish/scriptish/wiki/Manual%3A-Metadata-Block#version - specifies that "A version string consists of one or more version parts, separated with dots". so 1.4.21 is definitely legal.

Although, actually, we went from 1.4.21 to 1.4.3 (facepalm). In my head I read that as 2-1 rather than 21.

That doesn't explain why the bump to 1.5.3 I just did in test project hasn't worked though... Perhaps there's some kind of cache involved, I'll wait a short while and then hit Update Now again later

That seems to have done the job, I guess there's either a cache within Greasemonkey or some kind of counter preventing you hitting Update too regularly.

OK, in which case, I think should probably do a non-release just to bump the version numbers and reduce them down to two elements so that anyone who is using the scripts gets the latest updates.

Also means I can validate that my phone actually updates them this time

Repo: RemoveAMP
Commit: 6cb28eb8214b489f060424442f6adf3e178c296b
Author: B Tasker <github@<Domain Hidden>>

Date: Thu Jun 13 16:52:33 2019 +0100
Commit Message: FKAMP-8 Bump version number

The only purpose of this commit (and release) is to move version numbers to having 2 sets of numbers rather than 3

The reason being that Greasemonkey has been claiming no updates are available (though that's partly because I ballsed up the numbering)



Modified (-)(+)
-------
greasemonkey_hook.user.js
greasemonkey_hook_googlesearch.user.js
redirect_to_non_amp_sites.user.js




Webhook User-Agent

GitHub-Hookshot/040b707


View Commit

OK, that's updated happily.

Marking this as done.

I don't know what it is with this project, but I've been a bit haphazard with it at times.
btasker changed status from 'Open' to 'Resolved'
btasker added 'Fixed' to resolution
btasker changed status from 'Resolved' to 'Closed'