lucid-fox / social-magick

An Open Graph Image generator plugin for Joomla 3 and 4
GNU General Public License v3.0
15 stars 1 forks source link

xml of beta3 says beta2 (so Joomla Update Manager loops) + issue with download link #29

Closed woluweb closed 3 years ago

woluweb commented 3 years ago

1. After installing beta3, Joomla Update Manager keeps saying that an update is available. And indeed, in Extensions > Manage it says that the installed version is beta2. I have checked: the xml file of the package has simply not been adapted.

2. Besides this, the Joomla throws an error when updating:

Warning
Update: :Extension: Could not open
Error
Invalid extension update

And indeed the link given is https://github.com/lucid-fox/social-magick/releases/1.0.0.b3/socialmagick.zip while the file name is this time not socialmagick.zip but socialmagick-1.0.0.b3.zip

nikosdion commented 3 years ago
  1. That's the cache in Joomla
  2. Oops, I'll fix the XML update file!
woluweb commented 3 years ago

Txs Nicholas!

Just to be clear, there are 2 different things to fix I think:

  1. for the download link, the name of the file but also the /releases/ which was missing in the url: https://github.com/lucid-fox/social-magick/releases/1.0.0.b3/socialmagick.zip => https://github.com/lucid-fox/social-magick/releases/download/1.0.0.b3/socialmagick-1.0.0.b3.zip

  2. for the version in the xml, b3 is still called b2: <version>1.0.0.b2</version> => <version>1.0.0.b3</version>

nikosdion commented 3 years ago

No, the version is correct. The XML update stream URL is https://raw.githubusercontent.com/lucid-fox/social-magick/main/update/socialmagick.xml and you can see <version>1.0.0.b3</version> in there.

Problem #1 has to do with Joomla itself. Joomla retrieves the update XML file only once every few hours: by default, every 6 hours (it's configurable between 1 and 24 hours).

When you go to the Update page it queries the #__update_sites table and checks which XML update URLs have not been accessed in at least this many hours. If there are any it loads them and compares the installed version with the latest in the XML file. If there is a different (not necessarily newer!) version it creates an entry in the #__updates table.

Regardless of the previous step, Joomla loads the #__updates records and checks them against the currently installed version of each extension reported as having an update. If the same version is installed it removes these records. Note that if a newer version than the latest update is installed it still thinks an update (downgrade...) is available. Silly old Joomla.

Finally, it displays the remaining #__updates records.

What happened before is that Joomla had already retrieved the update information and the latest version it was seeing was beta 2 since you downloaded beta 3 before I updated the XML update file. Beta 2 and beta 3 are different versions therefore it "saw" an update from beta 3 to... beta 2.

Normally, you can clear the update cache and retrieve the updates again. HOWEVER since you have enabled Joomla's cache this will not work. You see, Joomla also caches the database queries in its page cache. So you have to clear the updates cache, go to Clear Cache, clear all of the Administrator cache, go back to the Updates page, clear the update cache again, then try to retrieve the updates again. I have been reporting this bug since 2014. If I'm not mistaken, this was fixed in 3.9.26 when Phil Taylor saw my long, technical rant on my business site about these issues and wrote the 5 lines PR to fix it. I had been trying to get the Joomla production leadership allow me to submit such a PR for 8 years. Well, better late than never and if it takes a long rant and someone else to write the code I've pretty much outlined in my rant so be it. I just want Joomla to work, whatever it takes.

woluweb commented 3 years ago

Txs Nicholas,

Actually, I was not even speaking of Joomla: What I simply meant is that (even now) In the Zip file of release b3 I read

1.0.0.b2

:)

So afaik, when you install b3 Joomla will keep thinking that you have b2 installed even if it is b3 :)

nikosdion commented 3 years ago

Ah, I am used to my own releases where the version bump automatically. I fixed it now.

woluweb commented 3 years ago

;)