matrix-js-sdk
e6f1714d - Freeze all events in the store

Commit
6 years ago
Freeze all events in the store Currently any event stored in the js-sdk can be modified by anything that does event.getContent() and then, accidentally or otherwise, modifies the object that is returned. This has scope for all sorts of strange behaviour and is generally terrifying. This PR freezes the events as they go into the model objects, although the event class itself does quite a bit of manipulation of this object (mostly in redactions) so there's quite a bit of code making a copy, modifying it and the refreezing it. This commit just modifies the events to be frozen and doesn't attempt to fix up any of the places we've been modifying the events, so this currently breaks everything. TODO: the interactions between redactions and edits look somewhat subtle: more may be needed here.
References
Author
Parents
Loading