Skip to content

Commit

Permalink
Ignore tldraw add shape with missing type field.
Browse files Browse the repository at this point in the history
We sometimes see events produced by BigBlueButton which look like
"update" events - they only have an id and point field (what you'd see
if you drag a shape to a different position), but they refer to a shape
id that hasn't previously been seen in the events file.

There's nothing that can be done except ignore the shape (and log a
message).

My suspicion is that the presenter might have triggered a bug which let
them drag the slide background image, since the events for the
background image are filtered out of the events.
  • Loading branch information
kepstin committed Oct 3, 2023
1 parent 5170709 commit 6347016
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bbb_presentation_video/renderer/tldraw/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,13 @@ def add_shape_event(self, event: tldraw.AddShapeEvent) -> None:
shape.update_from_data(data)
action = "updated"
else:
shape = parse_shape_from_data(data)
self.shapes[presentation][slide][id] = shape
action = "added"
if "type" in data:
shape = parse_shape_from_data(data)
self.shapes[presentation][slide][id] = shape
action = "added"
else:
print(f'\tTldraw: Got add for shape: {id} with missing "type" field')
return

try:
del self.shape_patterns[id]
Expand Down

0 comments on commit 6347016

Please sign in to comment.