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.
This change should have no user impact.
`FailedMessagesJob`, `IncompleteCallsJob`, and
`FailedAttachmentDownloadsJob` used to inherit from `Dependencies`. Now,
they explicitly take their one dependency: a database.
I also made a few methods private because they didn't need to be
exposed.
* Factor out RegistrationCoordinatorLoader
* Add PNI change number state to regcoordinatorloader
* Don't exit change number flow once we start a pni operation
* Add ChangePhoneNumberPniManager to reg coordinator dependencies
* add params required for pni to change number registration mode
* change number from regcoordinator
* rename ChangePhoneNumber -> LegacyChangePhoneNumber
* remove pni change number support from LegacyChangePhoneNumber
* remove codable conformance from pni change number manager's pending state
* Update ts account manager state when finalizing change number
* Add message processor deps to reg coordinator
* addAsyncCompletion on dbv2 write transactions
* Suspend message processing while doing a reg coordinator change number
* hook up change number
* Add handler-free message processing suspension method
* odds and ends
* minor cleanup
* slight refactor to finalize change phone number in the export function
* Put wait for message processing + suspend onto messageProcessor
* kick of prekey refresh after pni change number finalize transaction ends
* nit
* add whoami request to reg coordinator
* Add pni change number params to reg bravo change number request
* Remove username as a requirement for reg coordinator's account identity
* pr feedback
This test-only change should have no user impact.
`PhoneNumberUtil.callingCode(fromCountryCode:)` was tested in two
places. This combines them and moves the tests to Swift.
* 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
* Catch re-entrant MockDBv2 transactions in tests
* Fix some promise + transaction issues in RegCoordinator
* undo dumdum changes; dont handle errors on a guarantee
* 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
From [the SQLite docs][0]:
> Query or change the fullfsync flag for checkpoint operations. If this
> flag is set, then the F_FULLFSYNC syncing method is used during
> checkpoint operations on systems that support F_FULLFSYNC. The default
> value of the checkpoint_fullfsync flag is off.
In other words, checkpoints should be more reliable (but possibly
slower).
[0]: https://www.sqlite.org/pragma.html#pragma_checkpoint_fullfsync
This change should have no user impact.
Two changes:
1. Calling `advance(to: timeInThePast)` is now a fatal error.
2. Calling `advance(to: currentTime)` is now tested.