Open aschuldhaus opened 7 years ago
Fixed in next commit (v0.7.7).
Issue re-appeared after rewriting some methods.
Looking into issue now.
Issue appears to be related to the unintentional duplication of instances of the same objects (soundData, musicData) being out of sync when updating. One copy might be up-to-date while the other is not, resulting in sounds existing or missing from library when they should not. This duplication is a result of the objects being part of the Util class, and the fact that two (or more) instances of this class are used; one during boot, and the other during operation.
As a fix, I am moving the soundData and musicData objects to be part of the bot.basic object, then re-referenced by the Util class, so multiple instances will reference the same sound/music data objects. I also need to find all locations these structures are updated; and make sure they are updating the basic.soundData or basic.musicData objects from now on (not changing what Util.soundData or Util.musicData are referencing, as this would reintroduce the bug during operation).
New sounds/songs are not correctly added to the library. They are not returned when searched, and/or are appended to the end of the sound/song list, rather than inserted alphabetically. Cause still unknown. Attempts to resolve this issue seem to have failed.
Best bet is this is an issue caused by the asynchronous behaviour of certain methods; order of execution.