at_libraries icon indicating copy to clipboard operation
at_libraries copied to clipboard

feat: improve onboarding_cli resilience

Open srieteja opened this issue 1 year ago • 4 comments

- What I did

  • removed qr_code related components from code
  • rename OnboardingUtil -> RegistrarApiUtil and consume this change
  • Delete .atKeys file if onboarding process encounters an unrecoverable exception/error
  • Retry each of the onboarding steps in case they encounter an exception

- How I did it

  • Introduced _deleteAtKeys() which checks if the atsign is already onboarded, if not deletes the atKeys file that has been created
  • Introduced OnboardingTask which is an abstract class that contains strucutre to retry a specific task in case it has encountered an Exception/Error or has not fetched necessary data. All the onboarding tasks have been rewritten by extending this class with varying maxRetries count to improve resilience.

- How to verify it

  • activate_cli should be working as usual
  • In case a certain task (updating pkamPubKey, encPubKey to remote) fails, onboarding_cli should retry those specific tasks. In case maxRetry count is exceeded, the .atKeys file should be deleted.
  • Unit tests on the way

- Description for the changelog

  • removed qr_code related components from code
  • rename OnboardingUtil -> RegistrarApiUtil and consume this change
  • Delete .atKeys file if onboarding process encounters an unrecoverable exception/error
  • Retry each of the onboarding steps in case they encounter an exception

srieteja avatar Jul 05 '23 13:07 srieteja

Unit tests on the way

srieteja avatar Jul 05 '23 14:07 srieteja

@srieteja What's the status of this PR?

gkc avatar Feb 15 '24 10:02 gkc

@gkc this PR is from before at_auth was introduced, so it requires some capacity to bring this PR up to speed. And since its not linked to a ticket anymore, it's low priority for me. Will bring this up to speed and get it closed as soon as I find some time.

srieteja avatar Feb 15 '24 10:02 srieteja

@gkc this PR is from before at_auth was introduced, so it requires some capacity to bring this PR up to speed. And since its not linked to a ticket anymore, it's low priority for me. Will bring this up to speed and get it closed as soon as I find some time.

Makes sense, thanks @srieteja

gkc avatar Feb 15 '24 10:02 gkc