Merge pull request #3575 from matrix-org/jryans/log-event-wo-id

Add diagnostic log to catch events without an ID
This commit is contained in:
J. Ryan Stinnett 2019-10-29 19:37:33 +02:00 committed by GitHub
commit cbd25ab1a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -495,6 +495,12 @@ module.exports = createReactClass({
return null; return null;
} }
const eventId = this.props.mxEvent.getId(); const eventId = this.props.mxEvent.getId();
if (!eventId) {
// XXX: Temporary diagnostic logging for https://github.com/vector-im/riot-web/issues/11120
console.error("EventTile attempted to get relations for an event without an ID");
// Use event's special `toJSON` method to log key data.
console.log(JSON.stringify(this.props.mxEvent, null, 4));
}
return this.props.getRelationsForEvent(eventId, "m.annotation", "m.reaction"); return this.props.getRelationsForEvent(eventId, "m.annotation", "m.reaction");
}, },