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

[pseudoIDs] Allow displayname changes, kick users on redaction #3131

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

S7evinK
Copy link
Contributor

@S7evinK S7evinK commented Jul 3, 2023

This PR changes a few things to allow displayname/avatar changes in pseudo ID rooms.

  • GetRoomsByMembership now queries the pseudo ID keys to get all rooms
  • When redacting a join event containing a mxid_mapping in content, the user leaves the room or is kicked
  • When redacting an event, we now also redact it in current_room_state (if needed)
  • When storing a membership event (e.g. join -> join) we now remove the mxid_mapping from unsigned.prev_content)
  • When receiving a membership event over federation, we check if it is a join -> join event and temporarily add a prev_content, so validating the event signature doesn't error because of a missing mxid_mapping

A few things we need to think about:
Considering that users can leave rooms on their own and rejoin them, we now have two join events with a mxid_mapping. Currently redacting the current join event results in a leave/kick, but we still have another unredacted mxid_mapping. It's up to the client to walk the unsigned.replaces_state field to redact other membership events containing a mxid_mapping

Kicking users, on redaction of a join event, may not always be possible, as the powerlevels could have been changed to allow redactions for PL50, but kicking is only allowed for PL100. How do we handle those cases? Temporarily fake/update the powerlevels to allow kicking?

@S7evinK S7evinK added the T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. label Jul 3, 2023
@S7evinK S7evinK requested a review from a team as a code owner July 3, 2023 07:23
@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Patch coverage: 42.50% and project coverage change: -0.14 ⚠️

Comparison is base (c809e95) 64.44% compared to head (cae2b61) 64.31%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3131      +/-   ##
==========================================
- Coverage   64.44%   64.31%   -0.14%     
==========================================
  Files         506      506              
  Lines       57011    57202     +191     
==========================================
+ Hits        36743    36788      +45     
- Misses      16442    16576     +134     
- Partials     3826     3838      +12     
Flag Coverage Δ
unittests 49.07% <42.50%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
federationapi/api/api.go 100.00% <ø> (ø)
federationapi/internal/api.go 79.16% <0.00%> (-1.35%) ⬇️
federationapi/internal/perform.go 37.47% <0.00%> (ø)
roomserver/api/api.go 66.66% <ø> (ø)
roomserver/internal/input/input_missing.go 65.28% <0.00%> (ø)
roomserver/internal/perform/perform_admin.go 38.93% <0.00%> (ø)
roomserver/internal/perform/perform_backfill.go 50.10% <0.00%> (-0.54%) ⬇️
roomserver/internal/query/query.go 57.12% <0.00%> (-0.97%) ⬇️
roomserver/storage/tables/interface.go 81.48% <ø> (ø)
roomserver/internal/input/input_events.go 51.28% <7.14%> (-4.80%) ⬇️
... and 8 more

... and 28 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

roomserver/storage/interface.go Show resolved Hide resolved
internal/transactionrequest.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants