-
-
Notifications
You must be signed in to change notification settings - Fork 665
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
PDU Sender split #3100
PDU Sender split #3100
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #3100 +/- ##
==========================================
- Coverage 66.23% 66.01% -0.22%
==========================================
Files 500 500
Lines 53862 54127 +265
==========================================
+ Hits 35677 35734 +57
- Misses 14591 14795 +204
- Partials 3594 3598 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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 need to be more rigorous to distinguish between event.UserID()
and QueryUserIDForSender(event.SenderID())
.
QueryUserIDForSender
should do a DB hit to answer:
- is this sender key mapped to a user ID at all? AND
- is this user ID local? (aka do I have a private key for this sender key)
I am struggling to identify a legit use case for event.UserID()
as I don't know how this field is actually getting set in GMSL (currently it just assumes sender ID is a spec.UserID
).
My intuition here would be to:
- remove
event.UserID()
entirely in GMSL. - Expect Dendrite to bounce via
QueryUserIDForSender
when it needs to map aSenderID
to aUserID
.
This keeps GMSL "pure" in that it dosn't need to care about "hey, I need to find the m.room.member
event for this sender of this message event to serve queries for event.UserID()
".
In the rare cases where GMSL needs the user ID for an event, we should interface up a function which Dendrite implements which ultimately calls QueryUserIDForSender
.
clientapi/routing/directory.go
Outdated
} | ||
} | ||
|
||
deviceSenderID, err := rsAPI.QuerySenderIDForUser(req.Context(), alias, *userID) |
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.
Do we expect this to create the sender ID if one does not exist? I guess in this case no, but in some cases yes?
Initial cut of splitting PDU Sender into SenderID & UserID