hoccer / hoccer-xo-iphone

iOS Client
0 stars 0 forks source link

Group chat - undeliverable messages after RSA key renewal (clients offline) #831

Closed ChristianeMussmacher closed 7 years ago

ChristianeMussmacher commented 7 years ago

Reproducible on iOS and Android client when group member clients are not online simultaneously after key has been renewed.

Steps to reproduce:

Test with Android client

1) Android client (A) creates group and invites

2) Client B & C accept invitation and kill App (wait one minute)

3) Client A changes RSA key and sends message to group chat --> ok

4) Client A changes RSA key, kills app, waits 1 minute and sends message to group chat --> message undeliverable

5) Client A kills app (wait one minute)

6) Client B and C open app and send message to group --> message delivered / sometimes empty messages


Test with iOS client

1) iOS client (A) creates group and invites

2) B & C accept invitation and kill app (wait one minute)

3) A changes RSA key and sends message to chat --> undeliverable until online at the same time as another group member

4) A changes key and kills application, B & C open app and send message to group chat --> 1 undeliverable / 1 sent --> sometimes when admin now joins conversation (all clients online), admin client receives empty messages

ChristianeMussmacher commented 7 years ago

@pavel-mayer / @elRadish

Testversion 3.2.15 - Including group bug fix:

A newly created group chat (nearby / normal group) is not working when only Android clients are members of the group. --> Messages can neither be send nor received. As soon as iOS client joins the group, all clients are immediately able to send and receive messages.

elRadish commented 7 years ago

05-15 16:51:16.825 8860-27813/com.artcom.hoccer.dev I/Hoccer﹕ [Thread-2378] INFO com.hoccer.talk.client.XoClient - can't decrypt group key because there isn't one yet 05-15 16:53:15.849 8860-27813/com.artcom.hoccer.dev I/Hoccer﹕ [Thread-2378] INFO com.hoccer.talk.client.XoClient - getEncryptedGroupKeys: Can't do it, I do not have the public key with id '76a9b7695dc8be0f' for a contact with id: 0a612962-58f1-4cad-8116-3b2ed631f9e8

elRadish commented 7 years ago

I fixed a wrong String comparison which caused the Android-only problems. https://github.com/hoccer/hoccer-talk-spike/tree/feature/1222_group_messages

elRadish commented 7 years ago

The initial problem is still present, I could reproduce "Test with iOS client"

ChristianeMussmacher commented 7 years ago

Tested in version 3.2.15 (430) - Problem "Test with Android and test with iOS" is still reproducible as documented above.

pavel-mayer commented 7 years ago
elRadish commented 7 years ago

After the latest Server update, I could reproduce the problem, but it recovered after the 2nd android client came back online.

Test

Die Logs kommen von Android-Client 1 (Group-Admin und Key-changer). Die beiden anderen Clients sind passiv.

Fehler auf beiden Clients: "Group key is not current"

05-19 17:03:36.786  18597-18651/? I/Hoccer﹕ [client-1] DEBUG com.hoccer.talk.client.XoClient - Hello: Current server time: Fri May 19 17:03:35 GMT+02:00 2017
05-19 17:03:36.866  18597-18659/? I/Hoccer﹕ [client-2] DEBUG com.hoccer.talk.client.XoClient - client 5274a948-70b0-4ae1-9970-137a74702c27 has current key
05-19 17:03:36.866  18597-18661/? I/Hoccer﹕ [client-3] DEBUG com.hoccer.talk.client.XoClient - client 4513485f-1711-4ddf-97af-d3ce777c2aa4 has current key
05-19 17:03:40.776  18597-18628/com.artcom.hoccer.dev I/Hoccer﹕ [Thread-4777] DEBUG better.jsonrpc.client.JsonRpcClient - RPC-Response <- [1] {"jsonrpc":"2.0","id":"d","result":[{"messageId":"a15c87cd-6c22-4cc9-b1ae-749e2519e1e7","messageTag":"9d89cfad-888f-4e33-8184-fea0d414e934","senderId":"2136ffec-07d6-40bd-89b9-98995e8e1f9f","receiverId":"4513485f-1711-4ddf-97af-d3ce777c2aa4","groupId":"fc536461-aed3-4495-9bcb-89bdb2977be5","state":"failed","timeAccepted":1495206219768,"timeChanged":1495206219768,"attachmentState":"none","reason":"group key for receiver is not current"},{"messageId":"a15c87cd-6c22-4cc9-b1ae-749e2519e1e7","messageTag":"9d89cfad-888f-4e33-8184-fea0d414e934","senderId":"2136ffec-07d6-40bd-89b9-98995e8e1f9f","receiverId":"5274a948-70b0-4ae1-9970-137a74702c27","groupId":"fc536461-aed3-4495-9bcb-89bdb2977be5","state":"failed","timeAccepted":1495206219768,"timeChanged":1495206219768,"attachmentState":"none","reason":"group key for receiver is not current"}]}
05-19 17:03:40.956  18597-18628/com.artcom.hoccer.dev I/Hoccer﹕ [Thread-4777] DEBUG better.jsonrpc.client.JsonRpcClient - RPC-Response <- [1] {"jsonrpc":"2.0","id":"e","result":{"messageId":"a15c87cd-6c22-4cc9-b1ae-749e2519e1e7","messageTag":"9d89cfad-888f-4e33-8184-fea0d414e934","senderId":"2136ffec-07d6-40bd-89b9-98995e8e1f9f","receiverId":"4513485f-1711-4ddf-97af-d3ce777c2aa4","groupId":"fc536461-aed3-4495-9bcb-89bdb2977be5","state":"failedAcknowledged","timeAccepted":1495206219768,"timeChanged":1495206220114,"attachmentState":"none","reason":"group key for receiver is not current"}}
05-19 17:03:41.146  18597-18628/com.artcom.hoccer.dev I/Hoccer﹕ [Thread-4777] DEBUG better.jsonrpc.client.JsonRpcClient - RPC-Response <- [1] {"jsonrpc":"2.0","id":"f","result":{"messageId":"a15c87cd-6c22-4cc9-b1ae-749e2519e1e7","messageTag":"9d89cfad-888f-4e33-8184-fea0d414e934","senderId":"2136ffec-07d6-40bd-89b9-98995e8e1f9f","receiverId":"5274a948-70b0-4ae1-9970-137a74702c27","groupId":"fc536461-aed3-4495-9bcb-89bdb2977be5","state":"failedAcknowledged","timeAccepted":1495206219768,"timeChanged":1495206220205,"attachmentState":"none","reason":"group key for receiver is not current"}}

Dann wird nach dem Start von Hoccer der Group-Key vom Client 1 angefordert und korrekt verteilt.

05-19 17:14:05.016  21027-21054/com.artcom.hoccer.dev I/Hoccer﹕ [Thread-4781] DEBUG better.jsonrpc.server.JsonRpcServer - RPC-Request <- [1] {"id":"2","jsonrpc":"2.0","method":"getEncryptedGroupKeys","params":["fc536461-aed3-4495-9bcb-89bdb2977be5","9MHTvMKMhMc=","qJJxNFrJMw7Md77UCaVDvEBM/s4TAsxC9/z7ASe5Ly4=",["5274a948-70b0-4ae1-9970-137a74702c27","4513485f-1711-4ddf-97af-d3ce777c2aa4"],["de7e3a5684200f22","69867d6a8e04af81"]]}
05-19 17:14:05.026  21027-21054/com.artcom.hoccer.dev I/Hoccer﹕ [Thread-4781] DEBUG com.hoccer.talk.client.XoClient - server: getEncryptedGroupKeys()
05-19 17:14:15.166  21027-21054/com.artcom.hoccer.dev I/System.out﹕ 2017-05-19 17:14:15,175 [DEBUG] BaseMappedStatement update data with statement 'UP