Make event_match work on booleans and integers
Currently event_match push rule conditions are evaluated against a flattened version of the event dict that drops all non-string values. This change converts booleans and integers into their string representation so that they can be matched as well.
Fixes: #13465 Signed-off-by: Johannes Marbach [email protected]
Pull Request Checklist
- [x] Pull request is based on the develop branch
- [x] Pull request includes a changelog file. The entry should:
- Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from
EventStoretoEventWorkerStore.". - Use markdown where necessary, mostly for
code blocks. - End with either a period (.) or an exclamation mark (!).
- Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
- Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from
- [x] Pull request includes a sign off
- [x] Code style is correct (run the linters)
I think this is essentially a duplicate of #12181, which was rejected as needing an MSC, which was written as MSC3758.
Ugh, thanks @clokep, I didn't realize there was another PR for this already. 🤦♂️
Ugh, thanks @clokep, I didn't realize there was another PR for this already. 🤦♂️
No problem, it took me a while to find but I was 99% sure there was one! They're not fully overlapping (and yours has tests!) though so could be good to combine them.
I wrote up MSC3862 describing the variant in this PR, too. This is not necessarily better than MSC3758 but I think having both options laid out side by side helps decide the way forward.
Closing this since https://github.com/matrix-org/matrix-spec-proposals/pull/3862 has been abandoned.