curiousdannii-testing / inform7-imported-bugs

0 stars 0 forks source link

[I7-1911] [Mantis 1947] Public Library page doesn't correctly update download buttons at the bottom after downloading extensions #173

Open curiousdannii-testing opened 2 years ago

curiousdannii-testing commented 2 years ago

Reported by : DavidK

Description :

At the the bottom of the Public Library page there are two buttons: one to download all missing extensions, and one to update all extensions that are out of date. The titles of these, and the list of extensions to download, are not correct after one or more extensions is downloaded.

The problem lies in the Javascript in the Public Library web page at http://emshort.com/pl/. In the script there are two arrays, containing the downloads to be done (window.getAllList and window.updateList) plus two integer variables giving their lengths (window.getAllLength and window.updateListLength). Items are added to these arrays, but never removed, and nor are the arrays reset.

When an extension is downloaded the front-end calls downloadSucceeded(), which in turn calls resetCounts(). This contains a long set of calls to query(), one for each extension, that adds to the above arrays if an extension is missing or out of date. The trouble is that these arrays should be reset before the calls to query(), otherwise extensions get counted twice or more.

Testing locally, a sufficient fix is to add this code just before all the calls to query():

window.getAllList = [];
window.getAllLength = 0;
window.updateList = [];
window.updateListLength = 0;

Steps to reproduce :


Additional information :

imported from: [Mantis 1947] Public Library page doesn't correctly update download buttons at the bottom after downloading extensions
  • status: Reported
  • resolution: Open
  • resolved: 2022-04-07T05:01:51+10:00
  • imported: 2022/01/10