at_client_sdk icon indicating copy to clipboard operation
at_client_sdk copied to clipboard

If the device is offline after reset, App remains struck in loading

Open purnimavenkatasubbu opened this issue 2 years ago • 1 comments

Describe the bug Resetting an atsign and then making the device offline, makes the app struck in loading. Eventually when the network is back the app still remains in the same state.

To Reproduce Steps to reproduce the behavior:

  1. Pair an atsign in @ wavi app and add some data
  2. Then reset the atsign from the dashboard
  3. Restart the app and switch off the network
  4. Switch on the network back

Expected behavior When the network is back the app should be able to sync successfully.

Screenshots

https://user-images.githubusercontent.com/43639593/172572355-c2d9903a-930e-41b6-b3e3-c63fe27c705c.mp4

Smartphone (please complete the following information):

  • Device: [e.g. Samsung Galaxy A50]
  • OS: [e.g. Android 11] ]

Were you using an @‎application when the bug was found?

  • [e.g. @ wavi]

Additional context App Logs I/flutter (26231): INFO|2022-06-08 13:19:06.698414|Monitor|Retrying start monitor due to error I/flutter (26231): INFO|2022-06-08 13:19:06.698888|NotificationServiceImpl|Attempting to retry in less than 15 seconds... Rejected I/flutter (26231): FINEST|2022-06-08 13:19:10.015035|SyncService|in _processSyncRequests I/flutter (26231): FINEST|2022-06-08 13:19:10.209474|SyncService|skipping sync - queue length 0 I/flutter (26231): FINEST|2022-06-08 13:19:13.329080|Monitor|_messageHandler received data I/flutter (26231): FINEST|2022-06-08 13:19:13.605319|Monitor|_messageHandler received data I/flutter (26231): FINER|2022-06-08 13:19:13.606045|Monitor|received response on monitor: data:_6fee5ddd-49d5-466d-8635-7afd9f4833f4@antique2frontbe:274babf3-6e98-42d9-89ba-031b0a6517a9 I/flutter (26231): FINER|2022-06-08 13:19:13.616382|Monitor|Authenticating the monitor connection: from result:_6fee5ddd-49d5-466d-8635-7afd9f4833f4@antique2frontbe:274babf3-6e98-42d9-89ba-031b0a6517a9 I/flutter (26231): FINER|2022-06-08 13:19:13.638979|Monitor|Authenticating the monitor connection: pkam:KwYU8O5EFTn/Ww+09xO4OiqBNzmvjFV0iwPuz1DVC+jE0s7tefKwyx4+ubTD2/Cakf1AoQFpuuWuhFb9mHu/J2Ak+t1yu3+cd29HNLk59jf5AfzypRYo9pytLmZULHP29J0XFgkrSmfn25HteqWPgB75FHhGVZw7JLHpXIvJo2RIyEJB328FS5VWJtFz48bSG0p6JseQ+qZPnpocSSlbZoDGq896MxstQwt69pM/h06B9gh9FGgQWYxRWKpftYAxKP+uS1tjRqFLDQbe1MYHyeXTXcnPIaQAf1WX4nIyeoDQ1Y6pzadWIaVKgc3GMsqKEssHxI84rEFfKBZf4WuVUA== I/flutter (26231): FINEST|2022-06-08 13:19:13.892635|Monitor|_messageHandler received data I/flutter (26231): FINER|2022-06-08 13:19:13.893353|Monitor|received response on monitor: error:AT0015-key not found : privatekey:at_pkam_publickey does not exist in keystore I/flutter (26231): INFO|2022-06-08 13:19:13.901832|Monitor|socket.listen onDone called. Will destroy socket, set status stopped, call retryCallback I/flutter (26231): FINER|2022-06-08 13:19:13.902689|NotificationServiceImpl|monitor retry for @antique2frontbe

client_sdk branch : fix_sync_bug atsign: @antique2frontbe (PROD)

purnimavenkatasubbu avatar Jun 08 '22 08:06 purnimavenkatasubbu

Investigated the issue and below are the observations:

  1. When an atsign is reset, the PKAM public key in server is lost. When the network is down, the client fails to write the PKAM Public key to the server. As a result, when the network is back the connections fails to authenticate and proceed with sync resulting in apps to struck.
  2. At the moment we do not have a check in at_client and at_lookup libraries to verify if the network is available before sending command to server.

sitaram-kalluri avatar Jun 28 '22 09:06 sitaram-kalluri