Open xinsight opened 4 years ago
Note: Only one message is sent to the server. If I restart the MXKRoomViewController
, I only see each outgoing message a single time (as expected).
Figured it out. Apparently you need to attach a store to your session. You have MXNoStore
, MXMemoryStore
or MXFileStore
. For example:
let session = MXSession(matrixRestClient: authenticatedRestClient)!
let store = MXMemoryStore()
session.setStore(store) { response in
guard case .success = response else {
fatalError("unable to set store")
}
session.start { response in
// ...
}
}
Would be nice for Matrix SDX to warn that a store was missing! Hopefully this issue can help someone else from some head-scratching.
I'm seeing duplicate messages when sending from
MXKRoomViewController
. It seems these are "local echo" messages, which are supposed to be removed after the message sent to the server.In
-[MXKRoomDataSource refreshEventListeners:]
- the event listener is created. It checks if there are outgoing messages, and then attempts to find the local echo.Two problems:
room.outgoingMessages.count
is zero. But even if that check is removed,pendingLocalEchoRelatedToEvent:
returns nil.The two messages in the room are almost identical - so i'm not sure how the matrix kit or matrix sdk is supposed to reliably detect the local echo. For example:
Anyone have any thoughts on why the local echo detection might be failing? Any workarounds? This issue happens consistently for me (and I'm not doing anything weird).