minigalaxy
minigalaxy copied to clipboard
Investigate issues with DownloadUI and state notifications
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.
Screenshot from me taken from master branch:
I can't reproduce the issue. Some more info is needed.
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:
- self.downloads uses the save_location string as key.
- The list does not automatically remove old entries
- The download instance held by
OngoingDownloadListEntryis the one used in interaction withDownloadManager
The following steps generate new Download instances that do not correctly update and thus are partly not interactable:
- after canceling a download from the game tile
- do not remove the canceled downloads from the list
- 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.
that is interesting, good find.
The download ui appears to work relatively stable currently. I'm closing this one.