matrix-org / sydent

Sydent: Reference Matrix Identity Server
http://matrix.org
Apache License 2.0
295 stars 83 forks source link

Unbind doesn't delete from global_threepid_associations #307

Open babolivier opened 4 years ago

babolivier commented 4 years ago

It looks like removeBinding removes the association from the local table (local_threepid_associations) but not from the global table (global_threepid_associations), which means the 3PID can still be looked up even after unbinding.

neilisfragile commented 4 years ago

@babolivier could you add some more detail on the impact? I'm not clear on what this means from a user point of view.

babolivier commented 4 years ago

Yes, sorry. Given global_threepid_associations is the table Sydent uses to perform lookups, it means that 3PIDs can still be looked up after they've been unbound, because Sydent doesn't delete all the data it had for the association it's being asked to remove.

richvdh commented 4 years ago

Yes, sorry. Given global_threepid_associations is the table Sydent uses to perform lookups,

so what's local_threepid_associations?

anoadragon453 commented 4 years ago

I know Sydent "replicates" bindings from local_threepid_associations to global_threepid_associations. Does it not replicate unbinds?

babolivier commented 4 years ago

Yes, sorry. Given global_threepid_associations is the table Sydent uses to perform lookups,

so what's local_threepid_associations?

We use it for outbound replication only afaict.

babolivier commented 4 years ago

I know Sydent "replicates" bindings from local_threepid_associations to global_threepid_associations. Does it not replicate unbinds?

Yes, that's what the initial comment says :slightly_smiling_face:

babolivier commented 4 years ago

Hmm, looks like I was wrong, it does delete from the global table, but it's doing so in a quite convoluted way. I'm not sure what caused the row on that table to not be deleted on the occurrence we thought we observed this bug. However, I think I've noticed a bug with that bit of the code, I'll investigate it tomorrow.