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

SDK: UISI AutoReporting #1386

Merged
merged 10 commits into from
Mar 25, 2022
Merged

SDK: UISI AutoReporting #1386

merged 10 commits into from
Mar 25, 2022

Conversation

langleyd
Copy link
Contributor

@langleyd langleyd commented Mar 3, 2022

@langleyd langleyd self-assigned this Mar 3, 2022
@langleyd langleyd changed the title UISI AutoReporting SDK: UISI AutoReporting Mar 3, 2022
@langleyd langleyd marked this pull request as ready for review March 16, 2022 21:37
@langleyd langleyd requested review from a team, gileluard and BillCarsonFr and removed request for a team March 16, 2022 21:39
Copy link
Contributor

@gileluard gileluard left a comment

Choose a reason for hiding this comment

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

LGTM. Just would like to have @manuroe approval for the breaking change and also you can check the potential approval.

@param onComplete the block called when the operation completes.
*/
- (void)handleRoomKeyEvent:(MXEvent*)event onComplete:(void (^)(void))onComplete;
- (void)handleToDeviceEvent:(MXEvent*)event onComplete:(void (^)(void))onComplete;
Copy link
Contributor

Choose a reason for hiding this comment

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

This may be an important breaking change. Is it OK for you @manuroe ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just for a bit of context. The function becomes a bit more general, so not just handling RoomKeyEvent but handles toDeviceEvents generally. The code to handle RoomKeyEvent is unchanged. The naming also made some of the code read better like here. It also matches the android implementation now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From chatting to Gil I think functionally we are happy with the changes, it was just the breaking change. I think I'm happy with the breaking changed based off previous conversations with @manuroe . But will catch up with him when he's back.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not against the change of this API. Plus, it seems it is used only internally.
But I wonder if we really this method. See my review comment.

/// Manages the adding, removing MXLiveEventListeners and dispatching of events to those listeners.
@objcMembers public class MXEventStreamService: NSObject {

var listeners = [MXLiveEventListener]()
Copy link
Contributor

Choose a reason for hiding this comment

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

If MXLiveEventListener subclasses NSObject we could use then NSHashTable<ObjectType>.weakObjectsHashTable() and that could be even safer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yea nice and MXMulticastDelegate looks like it is a perfect fit here.

@langleyd langleyd requested a review from gileluard March 21, 2022 17:13
Copy link
Contributor

@gileluard gileluard left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Only thing is the breaking change in MXCrypto

onComplete();
break;
}
[self.mxSession.eventStreamService dispatchOnLiveToDeviceWithEvent:event];
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need to have this dependency on MXSession here?
Can this block stay in MXSession here?

I cannot see this method used outside the SDK. The related app PR do not use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mxSession is already a hard dependency in crypto, i just re-used it.
Android handles toDeviceEvents in crypto like this and it made the caller site clearer in some instances as we were passing a toDevice variable.
But I really don't feel strong about it, so happy to move it back, Will create a new PR.

@langleyd langleyd merged commit a24a5d1 into develop Mar 25, 2022
@langleyd langleyd deleted the langleyd/5017_uisi_autoreporter branch March 25, 2022 10:21
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