KeyError: 'thumbnail_info' when posting sticker from matrix #60

Closed
opened 2022-08-09 13:17:50 +00:00 by thrrgilag · 1 comment
thrrgilag commented 2022-08-09 13:17:50 +00:00 (Migrated from gitlab.com)

It appears stickers don't always have thumbnail_info when being posted to a channel. At least one particular sticker results in the following exception...

appservice - ERROR - Exception on /transactions/11 [PUT]                           
Traceback (most recent call last):                                                 
  File "/home/pnut-matrix/env/lib/python3.10/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()                                        
  File "/home/pnut-matrix/env/lib/python3.10/site-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)                                             
  File "/home/pnut-matrix/env/lib/python3.10/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()                                                   
  File "/home/pnut-matrix/env/lib/python3.10/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/home/pnut-matrix/pnut-matrix/appservice.py", line 111, in on_receive_events
    new_sticker(event, user)                                                       
  File "/home/pnut-matrix/pnut-matrix/appservice.py", line 160, in new_sticker  
    value['width'] = event['content']['info']['thumbnail_info']['w']               
KeyError: 'thumbnail_info'
It appears stickers don't always have thumbnail_info when being posted to a channel. At least one particular sticker results in the following exception... ``` appservice - ERROR - Exception on /transactions/11 [PUT] Traceback (most recent call last): File "/home/pnut-matrix/env/lib/python3.10/site-packages/flask/app.py", line 2077, in wsgi_app response = self.full_dispatch_request() File "/home/pnut-matrix/env/lib/python3.10/site-packages/flask/app.py", line 1525, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pnut-matrix/env/lib/python3.10/site-packages/flask/app.py", line 1523, in full_dispatch_request rv = self.dispatch_request() File "/home/pnut-matrix/env/lib/python3.10/site-packages/flask/app.py", line 1509, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) File "/home/pnut-matrix/pnut-matrix/appservice.py", line 111, in on_receive_events new_sticker(event, user) File "/home/pnut-matrix/pnut-matrix/appservice.py", line 160, in new_sticker value['width'] = event['content']['info']['thumbnail_info']['w'] KeyError: 'thumbnail_info' ```
thrrgilag commented 2022-08-09 13:17:50 +00:00 (Migrated from gitlab.com)

assigned to @thrrgilag

assigned to @thrrgilag
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: spacenerdmo/pnut-matrix#60
No description provided.