mycroft-core icon indicating copy to clipboard operation
mycroft-core copied to clipboard

self.gui does not sync dicts correctly

Open JarbasAl opened this issue 4 years ago • 2 comments

the base gui class only syncs values for top level keys

  • self.gui["x"] = y -> syncs
  • self.gui["some_dict"]["x"] = y -> does not sync

proposed fix

https://github.com/HelloChatterbox/HolmesV/commit/64b77f297eadda6eca55f1e990934d5ba867d1cc

JarbasAl avatar Aug 15 '21 15:08 JarbasAl

Hmm, haven't run into this, but I'm sure we will as GUI's get more complicated.

Would this be easier if we shift the dict to be it's own dict eg, self.gui.data[key]?

krisgesling avatar Aug 18 '21 06:08 krisgesling

i hit this here https://github.com/OpenVoiceOS/OVOS-workshop/blob/master/ovos_workshop/frameworks/playback/interface.py#L484

i was assigning 2 keys under "media" and they did not propagate, because they dont hit the __set__ method from the GUI class. also note that each assignment sends 1 bus message, so that linked method now is optimized to send 1 bus message only

JarbasAl avatar Aug 18 '21 11:08 JarbasAl