-
Notifications
You must be signed in to change notification settings - Fork 216
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
Include ID server access token in 3pid invites. #1518
Conversation
@@ -2523,7 +2584,7 @@ - (MXHTTPOperation*)inviteByThreePid:(NSString*)medium | |||
operation = [self addIdentityAccessTokenToParameters:parameters success:^(NSDictionary *updatedParameters) { | |||
MXStrongifyAndReturnIfNil(self); | |||
|
|||
MXHTTPOperation *operation2 = [self inviteByThreePidToRoom:roomId parameters:parameters success:success failure:failure]; | |||
MXHTTPOperation *operation2 = [self inviteByThreePidToRoom:roomId parameters:updatedParameters success:success failure:failure]; |
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.
Everything was already setup for invites, there was simply a bug.
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.
Could we capture that bug in an integration test? (MXRestClientTests
do not currently run on CI, but should be also enabled in the future)
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.
It's a good point, I'll take a look. I did have a scan through the SDK tests but we don't seem to have anything covering the identity server or 3pid functionality (possibly due to not having an identity server set up), but would be really good to have this covered with some sort of test.
Codecov Report
@@ Coverage Diff @@
## develop #1518 +/- ##
===========================================
- Coverage 11.67% 11.65% -0.02%
===========================================
Files 507 507
Lines 83204 83254 +50
Branches 35536 35561 +25
===========================================
- Hits 9711 9705 -6
- Misses 73135 73191 +56
Partials 358 358
Continue to review full report at Codecov.
|
@@ -2523,7 +2584,7 @@ - (MXHTTPOperation*)inviteByThreePid:(NSString*)medium | |||
operation = [self addIdentityAccessTokenToParameters:parameters success:^(NSDictionary *updatedParameters) { | |||
MXStrongifyAndReturnIfNil(self); | |||
|
|||
MXHTTPOperation *operation2 = [self inviteByThreePidToRoom:roomId parameters:parameters success:success failure:failure]; | |||
MXHTTPOperation *operation2 = [self inviteByThreePidToRoom:roomId parameters:updatedParameters success:success failure:failure]; |
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.
Could we capture that bug in an integration test? (MXRestClientTests
do not currently run on CI, but should be also enabled in the future)
Thanks for jumping on this so quickly @pixlwave! ❤️ |
Most of the changes in this PR are for invites as part of room creation. Sending an ordinary invite had all the right logic, but also a bug.
I did consider adding the access token field to
MX3PIDInvite
however given the homeserver could say it isn't needed, this didn't seem great with the json dictionary property checking for a specific number of fields.Fixes element-hq/element-ios#6385