Why would you use Olm/Megolm for your chat protocol? Even Matrix doesn't want to be using it anymore (they're in theory planning a transition to IETF MLS, last I checked). Group E2E is incredibly hard to get right, not just because of the underlying cryptographic constructions, but because all the metadata and signaling that rides on top of and alongside the group encrypted messaging layer also influences key distribution.
If you're literally just doing a front end to Matrix, I get why you have to use the current Matrix protocol. But if you're doing something that isn't Matrix, you should avoid Olm.
If you're literally just doing a front end to Matrix, I get why you have to use the current Matrix protocol. But if you're doing something that isn't Matrix, you should avoid Olm.