This should cause no change in behavior.
We had logic like this pseudocode:
```
unreadCount = db.countUnreadMessages()
messagesWithUnreadReactionsCount = db.countMessagesWithUnreadReactions()
if unreadCount == 0 && messagesWithUnreadReactionsCount == 0 {
// Avoid unnecessary writes.
return
}
db.markMessagesRead()
```
This optimization works but has two problems:
1. We don't actually need the count. We just need to know whether
anything exists.
2. If there are unread messages, we should do the cleanup regardless,
and we don't need to do the second check query.
Now the pseudocode looks like this:
```
if db.hasUnreadMessages() || db.hasMessagesToMarkRead() {
// Avoid unnecessary writes.
return
}
db.markMessagesRead()
```
* Use schedulers with ChainedPromise
* Add full queue initializer redirection in Schedulers
* pass scheduler to OWSURLSession
* Use schedulers in SystemStoryManager
* make SystemStoryManagerTest synchronous
* Move resend code buttons above keyboard
* add showHelpText to verification code screen state
* hook up help button, does nothing yet
* show help bottom sheet
* lint
* pr feedback
* show back to back errors on verification code screen
* handle verification code attempts exhausted
* let the user resend a code after submission attempts are exhausted
* clear last digit after an incorrectly entered verification code
* wipe errors and allow proceeding when changing e164
* lint
* Don't wipe local kbs state when kbs stuff fails for change number; its still valid for the old number
* remove remaining error sheet todos
* fix tests
* add error message for rate limiting as it appears in mocks
* update colors in verification code view when theme changes
* Set validation state when we can't submit a verification code yet
* show alert when trying to submit verification code too many times
* handle changing e164 once we have a session
* Handle rate limit for recovery password based registration
* handle rate limit for session based createAccount/changeNumber request
* lint
* 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
* Fix name collision.
`UIView.autoPinEdgesToSuperviewEdges(withInsets:)` declared in SignalUI
was doing the same thing as `-[UIView autoPinEdgesToSuperviewEdgesWithInsets:]`
in PureLayout. Xcode 14.3 has started treating this ObjC name collision as an error.
* Fix warnings that would be errors in Swift 6.