-
Notifications
You must be signed in to change notification settings - Fork 213
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
SDK: UISI AutoReporting #1386
Conversation
…angleyd/5017_uisi_autoreporter
…angleyd/5017_uisi_autoreporter
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.
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; |
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.
This may be an important breaking change. Is it OK for you @manuroe ?
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.
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.
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.
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.
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.
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]() |
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.
If MXLiveEventListener
subclasses NSObject
we could use then NSHashTable<ObjectType>.weakObjectsHashTable()
and that could be even safer.
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.
Oh yea nice and MXMulticastDelegate
looks like it is a perfect fit here.
…k references to the listeners.
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.
LGTM 👍 Only thing is the breaking change in MXCrypto
onComplete(); | ||
break; | ||
} | ||
[self.mxSession.eventStreamService dispatchOnLiveToDeviceWithEvent:event]; |
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.
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.
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.
Accompanies app PR element-hq/element-ios#5743
To address element-hq/element-ios#5017