sugarlabs / sugar

Sugar GTK shell
GNU General Public License v3.0
252 stars 240 forks source link

KeyError: 'type' #924

Open Saumya-Mishra9129 opened 4 years ago

Saumya-Mishra9129 commented 4 years ago

Tested on Pippy with Sugar 0.117 and with Ubuntu 20.04

Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/jarabe/model/neighborhood.py", line 1035, in __activity_updated_cb
       bundle = registry.get_bundle(properties['type'])
KeyError:  'type'

How to reproduce - Open Pippy, click on neighborhood icon to share with other user, close pippy, check shell.log.

quozl commented 4 years ago

Does not reproduce for me with Sugar 0.117 on Ubuntu 20.04, so there may be something unique about the configuration or execution environment.

Purpose of the callback is to update the neighbourhood view to show that an activity that was not shared is now shared. The icon is to appear in the view.

Speculating can be wasteful, but my best guess is that you're using a virtual machine, with multiple virtual CPU cores or threads, and that the change to GObject properties of the activity is being asynchronously delivered by D-Bus, such that there isn't even a type key (content bundle or activity bundle) for a short time. If so, debug by adding instrumentation (log the properties keys) or a breakpoint.

Saumya-Mishra9129 commented 4 years ago

Speculating can be wasteful, but my best guess is that you're using a virtual machine, with multiple virtual CPU cores or threads, and that the change to GObject properties of the activity is being asynchronously delivered by D-Bus, such that there isn't even a type key (content bundle or activity bundle) for a short time.

Have you tested with Native Sugar? If so then , It can be related to Virtual machine.

quozl commented 4 years ago

Yes, I'm testing with laptops, not virtual machines. My speculation would be easy for you to test, have you tried that yet?

Saumya-Mishra9129 commented 4 years ago

Yes, I'm testing with laptops, not virtual machines. My speculation would be easy for you to test, have you tried that yet?

I have tried it as you said. I have tried logging the properties key. No key is present at the time this section of code runs. It seems you were correct.