Skip to content

Conversation

@bramley
Copy link
Contributor

@bramley bramley commented Dec 19, 2021

There are still reports in the user forum of problems with using the updater. Mostly either it stops with no indication of the problem, or "Downgrade not supported" is displayed which is probably a misleading result of an earlier problem.
Also the way that the updater identifies and handles the current version is a bit unclear and possibly error-prone.

There are three commits here:

  1. get the current version from the config table instead of parsing the init.php file. Show that a new release is available only when the installed version is lower than the latest version.
  2. Remove step 10 "Check for downgrade" which now cannot happen due to 1)
  3. Add throwing an exception when downloading or unzipping the new release fails. Add a catch-all try/catch for any unhandled exceptions to allow a json response to be sent to the browser.

Together these should at least provide more information to the user if something goes wrong with the update.

Show update available only when the installed version is lower than the latest version.
… fails.

Catch any unhandled exception to be able to send a json response to the browser.
@michield
Copy link
Member

This is tricky to test, as it requires a new version and that's not the case when we roll this out as a new version.
Also we should use the constant VERSION for determining the current version.

Your changes are hard to compare as they are in big blocks, so I'm just going to take a leap of faith :-)

@michield michield merged commit 4e9274b into phpList:master Jan 19, 2022
@bramley
Copy link
Contributor Author

bramley commented Jan 19, 2022

I tested it by changing the version row in the config table to a lower value. The database version will usually be the same as the VERSION constant, if they are different then phplist displays a warning to upgrade the database.
If someone tries to update the code despite having an earlier database, then this change will let them do that. But all they are doing is updating the code to the same version.

The other changes are just to try to get more information displayed when the updater fails.
I also had not realised until recently that the updater doesn't update itself. The only way to get the latest updater code is through a manual update. I wondered whether it would be a good idea to update the updater each time someone runs it.

@bramley
Copy link
Contributor Author

bramley commented Jan 21, 2022

Your changes are hard to compare as they are in big blocks

This might be caused by whitespace changes. They can be hidden using the gear icon
image

@michield
Copy link
Member

Ah, yes, thanks, that's useful

@bramley bramley deleted the detect_current_version branch March 11, 2022 08:27
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