-
Notifications
You must be signed in to change notification settings - Fork 57
Don't delete devices marked as dehydrated devices #4268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
550a615
to
20e2e24
Compare
Opens #4269 |
crates/matrix-synapse/src/lib.rs
Outdated
let existing_devices: HashSet<String> = body | ||
.devices | ||
.into_iter() | ||
.filter(|d| d.dehydrated.is_none()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could also alternatively consider hiding dehydrated devices from the admin API, but in principle I think it does make sense to show them there, so happy with this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that said, shouldn't we have d.dehydrated != Some(true)
here, or make dehydrated: bool
with a default of false? (probably in favour of the latter since that's the simplest and the semantics match)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
though the struct is serialised again, so Option<bool>
makes sense unless we split the usage — I'll change the filter condition, push, merge
crates/matrix-synapse/src/lib.rs
Outdated
let existing_devices: HashSet<String> = body | ||
.devices | ||
.into_iter() | ||
.filter(|d| d.dehydrated.is_none()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that said, shouldn't we have d.dehydrated != Some(true)
here, or make dehydrated: bool
with a default of false? (probably in favour of the latter since that's the simplest and the semantics match)
MAS tries to delete all the devices that it doesn't know about. This PR makes it ignore the dehydrated device (as reported by Synapse), so that it won't get deleted.
Companion PR: element-hq/synapse#18252
Part of a fix to element-hq/element-meta#2784