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

Improve searching in the userdir #4846

Merged
merged 16 commits into from
Mar 14, 2019
Merged

Improve searching in the userdir #4846

merged 16 commits into from
Mar 14, 2019

Conversation

hawkowl
Copy link
Contributor

@hawkowl hawkowl commented Mar 11, 2019

Fixes #4833

@hawkowl hawkowl changed the base branch from master to develop March 11, 2019 13:37
@codecov
Copy link

codecov bot commented Mar 11, 2019

Codecov Report

Merging #4846 into develop will decrease coverage by 0.34%.
The diff coverage is 69.73%.

@@             Coverage Diff             @@
##           develop    #4846      +/-   ##
===========================================
- Coverage    75.31%   74.96%   -0.35%     
===========================================
  Files          340      340              
  Lines        34924    35221     +297     
  Branches      5718     5824     +106     
===========================================
+ Hits         26302    26404     +102     
- Misses        7009     7179     +170     
- Partials      1613     1638      +25

@hawkowl hawkowl requested a review from a team March 11, 2019 14:08
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

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

Can you please talk me through why we need both users_who_share_public_rooms and users_in_public_rooms? Do we still want to have users_who_share_public_rooms, users_who_share_private_rooms and users_in_public_rooms? I'm broadly very confused what those changes are giving us, and why we need to recalculate everything from scratch

synapse/storage/user_directory.py Outdated Show resolved Hide resolved
@hawkowl
Copy link
Contributor Author

hawkowl commented Mar 12, 2019

@erikjohnston wrt why we have in public and in private rooms: #4833 (comment)

I'd like to get rid of the cross product of those sharing public rooms, but then we'd need to come up with a new way of figuring out how to tell if we need to purge remote users from the user directory.

@hawkowl
Copy link
Contributor Author

hawkowl commented Mar 12, 2019

Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

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

Ok, I think this looks OK. Though I think if we're going to bother creating a users_in_public_rooms we should have a firm plan to kill off users_who_share_public_rooms in the short term, as otherwise it seems to be a bit of a pointless table tbh

synapse/server.py Show resolved Hide resolved
synapse/storage/user_directory.py Outdated Show resolved Hide resolved
synapse/storage/user_directory.py Outdated Show resolved Hide resolved
@erikjohnston
Copy link
Member

Don't we already have a users_in_public_rooms table?

@hawkowl
Copy link
Contributor Author

hawkowl commented Mar 12, 2019

@erikjohnston yes, but it had some incredibly weird "last room" room ID.

synapse/storage/schema/delta/53/users_in_public_rooms.sql Outdated Show resolved Hide resolved
synapse/storage/user_directory.py Outdated Show resolved Hide resolved
synapse/storage/user_directory.py Outdated Show resolved Hide resolved

return self.runInteraction(
"add_users_who_share_room", _add_users_who_share_room_txn
)

def add_users_in_public_rooms(self, room_id, user_ids):
"""Insert entries into the users_who_share_private_rooms table. The first
user should be a local user.
Copy link
Member

Choose a reason for hiding this comment

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

We don't seem to handle the first user in any special way?

@erikjohnston erikjohnston merged commit 9073cfc into develop Mar 14, 2019
@hawkowl hawkowl deleted the hawkowl/userdir-search branch May 21, 2019 15:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants