Open
Description
There have been numerous occasions over the years where we accidentally include message contents in rageshakes, most recently #26376.
A common failure mode is to write something like:
let event = getEventFromSomewhere();
// ...
logger.info("Processing event", e);
What happens then is that we call JSON.stringify
(https://github.com/matrix-org/matrix-react-sdk/blob/v3.82.0/src/rageshake/rageshake.ts#L94) which in turn calls MatrixEvent.toJSON
, which includes the message content.
I assert that we should either:
- change the existing consumers of
MatrixEvent.toJSON
to use some other method, then updatetoJSON
to elide message content - special-case
MatrixEvent
in rageshake.log