Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Best way to delete event data #8114

Closed
ehounake opened this issue Aug 18, 2020 · 3 comments
Closed

Best way to delete event data #8114

ehounake opened this issue Aug 18, 2020 · 3 comments

Comments

@ehounake
Copy link

Hi,

We are using matrix in production and because of our usage we ended up with an essential need.

What I have:
We have some rooms with bots that post data each 15/30/60/ secs as state events (e.g. env1.metrics) with a key (e.g. api1).
The problem is that for each state_event/key, we have all the data from previous update of the event stacking in the database.
The database will eventually grow to reach the limit of allocated space. Deletion of row corresponding to the event in database make the room unusable.

What I need:
An enpoint for events/state_events deletion by id or between two date for a state_event/key, ensuring that the data and the entries are actually deleted in the database and in the room (at least when the room is not encrypted).

@clokep
Copy link
Member

clokep commented Aug 18, 2020

I think the purge history admin API will do what you want, but I'm not 100% sure.

@clokep
Copy link
Member

clokep commented Aug 20, 2020

I'm going to close this since I believe the API already exists for this. If that solution doesn't work please re-open it (or provide more information of why it doesn't).

@clokep clokep closed this as completed Aug 20, 2020
@ehounake
Copy link
Author

ehounake commented Sep 3, 2020

@clokep
After testing I confirm that the API purge history delete room events like m.room.messages etc...
In the use case explained before we are using state_events like this: /_matrix/client/r0/rooms/${room}/state/project.metrics/appmetrics
When running the purge with:

{
"delete_local_events": true,
"purge_up_to_ts": {now}
}

While all messages are deleted, the state event are still there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants