Skip to content
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

User search: profile replication from HS #56

Merged
merged 3 commits into from
Apr 27, 2018
Merged

User search: profile replication from HS #56

merged 3 commits into from
Apr 27, 2018

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Apr 16, 2018

Accept profile replication push from the HS and save profile data to the database.

NB. This is missing the signature verification that validates the HS is who it says it is

@dbkr dbkr mentioned this pull request Apr 16, 2018

bad_uids = []
for uid, info in batch.items():
if 'display_name' not in info or 'avatar_url' not in info:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly surprised we don't just ignore malformed profile updates? Especially as it's presumably quite common for only one of display_name or avatar_url to be updated, so it might feel reasonable to skip the other field?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it does feel like unchanged fields could be omitted (not that synapse would know how) but this would apply moreso if we had extensible profiles. It would make for some slightly more complex SQL on sydent.

@ara4n
Copy link
Member

ara4n commented Apr 25, 2018

this generally lgtm, although i'm slightly surprised that we're having to synthesise and track our batch IDs on both client and server like this, and I'm a bit scared about what happens if a sending HS implementation finds it hard to generate monotonically increasing IDs, or if the HS drops its DB and then has no way of knowing how to restart the sync process?

So the sender doesn't have to generate exactly sequential batches.
@dbkr
Copy link
Member Author

dbkr commented Apr 25, 2018

Good point, and I realised that synapse as is could easily skip batch numbers if someone updated their profile twice in quick succession. I've made sydent accept any batch number greater than the previous, which hopefully loosens the requirements on senders a bit.

If the HS drops its db, everything probably needs to start from scratch anyway since it presumably wouldn't know what data the target doesn't have either.

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

Successfully merging this pull request may close these issues.

3 participants