* put rereg mode params into a struct for sharability
* add step and UI handling for when we become deregistered during post-reg steps
* handle dereg when syncing push tokens
* show generic error on kbs backup failure
* handle dereg when restoring from kbs
* handle dereg during profile setup steps
* finalize pni stuff before deregistering
* add comment
* change debug fail to log
* Navigate to verification vc before showing popup so that we don't cancel the nav controller pop
* send a session sms code even if we get interrupted right after session creation
* improve state handling for initial session sms code
* nit: make var fileprivate
* show error when state changed on screen
This change should have no user impact. I think it's useful on its own
but it also makes a future task easier.
You can't ever have a negative number of remaining PIN attempts, so I
made sure we're using unsigned ints everywhere.
We also had two identifiers for "remaining attempts" (`triesRemaining`
and `remainingAttempts`) so I standardized it.
* Move AccountAttributes into shared file
* Add AccountAttributesRequestFactory
* Add new AccountAttributes generators
* Migrate verifyPrimaryDeviceRequest
* Migrate verifySecondaryDeviceRequest
* clarify the role of secondary device account attributes
* Remove AuthKey from AccountAttributes; it was unused on the server and therefore totally vestigial
* remove old updatePrimaryDeviceAttributes request and associated code
* Add registration recovery password to AccountAttributes
* Unconditionally set account attributes when changing or setting the PIN
* fix tests
* easy pr comments
* dont set v1 2fa pin unless no kbs backups exist
* Go to chat list view after registration
* sync system contacts during registration
* Use explicit local credentials for storage service operations during registration
* fix tests
* Quick hack to get through double pin confirmation
* Finishing touches
* lint
* fix build
* reload phone number discoverability after storage service sync
* fix tests again
* Take chat auth on account and contact record initializers
* Change around branches for clarity in OWSUserProfile
* pr comments
* Split ChatServiceAuth into the same and AuthedAccount
* fix tests
* merge woes
* Retry most network failures in RegistrationCoordinator
* Update the way we identify network errors to be more flexible
* Retry remaining requests
* Automatically retry registration requests if time intervals are short
* fix error types not compiling on kbs
* Add test for reg recovery password reg with retries
* fix extra t
* Finish registration in RegistrationCoordinator
* Get tests to compile again (but not pass)
* Tests passing again
* Test session happy path all the way through to completion
* Test KBS auth credential happy path all the way through to completion
* Test KBS reg recovery password happy path all the way through to completion
* PR comments
* Add ability to compute registration recovery password
* Add RegistrationCoordinator
* remove repeat nav controller that evan added
* Scaffolding for RegistrationCoodinator test
* Add first round of RegistrationCoordinator tests, some stuff I needed to get them working, and some fixes to RegistrationCoordinator itself I discovered thanks to the tests
* switch to owsFailBeta
* Add auth credential candidate flow tests, related fixes and additions to coordinator and friends
* Add tests for session based registration path and associated fixes
* PR comment nits
* Put KeyBackupService in its own folder
* Put SDSKeyValueStore in its own directory
* Put SDSDatabaseStorage in its own directory
* Stop doing useless dispatches in SDSTransactable
* Add V2 DB classes
* Wrap SDSKeyValueStore in a protocol and factory
* Make TSConstantsProtocol public to take it as a param in other places
* Take explicit transactions and do single lookups in TSAccountManager registration state methods
* Take explicit transaction on OWS2FAManager
* Make KeyBackupService an instance that takes dependencies on init
* Protocolize KeyBackupService
* Put Dependencies+SSK in its own directory
* Add DependenciesBridge
* add ViewControllerContext
* used shared context in OnboardingController
* Don't check KeyBackupService in RemoteConfigManager; the one and only callsite already checks it separately
* All the random cleanup that needed to happen to get the app to build again.
* Add mock dbv2 classes
* Migrate existing KeyBackupServiceTests
* Namespace KBS shims
* DBV2 -> DB, after changing the min swiftlint type length to 2 chars
* add toy example
* Unwrap writes as reads
* pr comments
* pr comments 2: return of the nits
* final Pr comment