matrix-org / gomatrixserverlib

Go library for matrix federation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Room version on Event leads to footguns

kegsay opened this issue · comments

It is never valid to call headeredEvent.Event because that will have Event.roomVersion as the empty string which will cause a subset of function calls on the event to fail. You have to call headeredEvent.Unwrap() to get it set correctly.

This isn't a great API shape as it produces subtle failures. Maybe we shouldn't embed Event into HeaderedEvent?

Can finally close this as HeaderedEvent is now dead!