minigalaxy icon indicating copy to clipboard operation
minigalaxy copied to clipboard

Investigate issues with DownloadUI and state notifications

Open GB609 opened this issue 6 months ago • 3 comments

See https://github.com/sharkwouter/minigalaxy/pull/683#issuecomment-2859059471

There appears to be an issue with the download ui not receiving all states properly and not having the control buttons.

GB609 avatar May 07 '25 15:05 GB609

Screenshot from me taken from master branch:

Image

I can't reproduce the issue. Some more info is needed.

GB609 avatar May 07 '25 15:05 GB609

I've found one issue in download_list.py, although it is not the same error that lead to the initial creation of this ticket: I had situations where i could not cancel files anymore. The UI seems to not do what i wanted. Turned out it did, but had the wrong data.

See the following code that adds entries to the ui

def __get_create_entry(self, change, download):
    if download.save_location not in self.downloads:
        self.downloads[download.save_location] = OngoingDownloadListEntry(self, download, change)
    return self.downloads[download.save_location]

Problem:

  1. self.downloads uses the save_location string as key.
  2. The list does not automatically remove old entries
  3. The download instance held by OngoingDownloadListEntry is the one used in interaction with DownloadManager

The following steps generate new Download instances that do not correctly update and thus are partly not interactable:

  1. after canceling a download from the game tile
  2. do not remove the canceled downloads from the list
  3. restart download from game tile

This leads to the creation of new Download instances which have the same save_location as before. As such, the 'old' OngoingDownloadListEntry instances are re-used when clicking some of the control buttons. When an active download shall be canceled, DownloadManager only does a direct instance check, it's not checking for the save_location. As such, it does not find the 'old' instance and it is not cancelable via download ui anymore.

I'd argue that this is mostly a test problem and the full cancel via game tile still works as well. It's ugly and should be fixed, but other bugs have a higher prio.

GB609 avatar May 08 '25 09:05 GB609

that is interesting, good find.

sharkwouter avatar May 09 '25 06:05 sharkwouter

The download ui appears to work relatively stable currently. I'm closing this one.

GB609 avatar Jul 01 '25 09:07 GB609