Right now we need to manually declare everything that gets serialized on our front end.
This is primarily to prevent infinite recursive serialization of events.
Related issues
1188
1186
1070
634
Proposed Actions
Re-write event_to_object to either have a max-depth of something reasonable like 10, or perform serialization in a way that auto-detects recursive behavior.
In terms of auto detection, the core idea would be to keep an temporary list of all events that have been serialized, and make sure to not serialize them twice. Here's some quick and dirty psuedocode...
function convert(event){
let current_objects = []
for object in event:
if !(object in current_objects){
current_objects.add(object)
}
...
}
For things that aren't serializable, we can skip them.
Current Situation
Right now we need to manually declare everything that gets serialized on our front end.
This is primarily to prevent infinite recursive serialization of events.
Related issues
1188
1186
1070
634
Proposed Actions
Re-write
event_to_object
to either have a max-depth of something reasonable like10
, or perform serialization in a way that auto-detects recursive behavior.In terms of auto detection, the core idea would be to keep an temporary list of all events that have been serialized, and make sure to not serialize them twice. Here's some quick and dirty psuedocode...
For things that aren't serializable, we can skip them.
Ref: https://stackoverflow.com/questions/11547672/how-to-stringify-event-object