I have read in the TOS for the Matrix server that all messages are deleted after one year. If I am talking with someone, does that mean that messages that are older than a year are deleted on my side, or both sides of the conversation? What if the chat is E2EE? If I am using a device that is signed in and has seen old messages, are they removed from that device too?
I think that’s for messages your client hasn’t received from the server yet. If you don’t login for a long time but keep getting messages that’s how long they’ll keep them.
Once all your clients have the message the server doesn’t need to keep it any longer. I’d expect them to discard it immediately after that, but I guess they don’t
That’s not how Matrix works. Matrix runs an internal DAG that stores all messages basically permanently.