If we hit an HTTP error during the handshake, we’ll get back a
badServerResponse error, and the `response` will indicate the error.
If we run into some other error later in the process, we’ll get back a
non-badServerResponse error, but the `response` will still be set based
on the most recent HTTP response (ie HTTP 101 Switching Protocols),
which isn’t actually the error that occurred.
* Add CallEvent sync message proto
* Add CallRecord class and db table
* Renames and comments for clarity
* create and update CallRecord from local device call events
* Handle incoming call event sync messages
* Add outgoing call sync event piping
* Send call event sync messages
* Handle call record sync messages before the app is launched
* Mark TSCall interactions as read and update their status when getting call event sync messages
* Prevent CallKit race conditions by checking state before creating TSCall interactions
* Update chat call event text for unanswered and declined calls
* Remove incorrect debug assert which fires every time a call is missed in the background
* PR comments, mostly nits
* convert old debug assert into a log + task comment
* nit
* Update copy for in chat call logs
* Smaller PR comments
* Add foreign key to CallRecord's interactionUniqueId
* Update write transaction ordering comment
* run genstrings
* fix strings
This was added in ab6c4a4c36, but the
server deosn’t support "v2/keys" via web socket, so the web socket
requests always fail and fall back to the REST endpoint.
Previously, low-trust SignalRecipients wouldn’t be marked as registered
unless they were newly-created. Now, they are marked as registered in
places where they should be (eg, successfully sending a message or
fetching a pre key means that the device exists).
As part of this change, SignalRecipients are unregistered by default,
though most call sites still mark them as registered immediately, so the
behavior in practice will be identical. There are a few places (such as
ensureAccountId) which will no longer mark new values as registered.
Finally, creating a new SignalRecipient would also update Storage
Service, even if that recipient was created in response to a storage
service update. Now, recipients updated as part of storage service
operations won’t immediately trigger another storage service update.
* Clean up recipient merging code
A number of properties were being fetched & validated repeatedly. It’s a
bit easier to follow if we validate them once at the beginning.
* Swiftify contact merging code
No material changes to the behavior.
If we fail to migrate the database due to corruption, we should bump the
user into the database recovery tool.
Tested this manually by corrupting the database and hitting this error.
* Allow using a transaction for checking APNS token
* Add APNSRotationStore
* add APNSRotationStoreTest
* Rotate APNS tokens in SyncPushTokensJob
* Mark NSE as having processed messages for token rotation
* Check for APNS token rotations after flushing incoming message queue
* pr comments
* Simplify APNS rotation conditions: we mark APNS as working when getting a push in either the NSE or the main app, and rotate if we missed a message since then.
* Mark APNS tokens as working if we ever get a push. Don't rotate known-good tokens.
* Added logging
* add remote flags to control behavior
* pr comments
* fix bad merge
* invert kill switch
* PR nit comments
* Avoid write transactions on the SyncPushTokensJob hot path
* Initial PR feedback, more to come
* Change of strategy: rotate if we have new messages to process on app startup
* PR comments
* use null for calltype column on incoming message rows
The NSE’s Info.plist didn’t contain a BuildTimestamp, so it wouldn’t
have a default expiration.
The new approach reads the main app’s expiration from all of the
extensions, which helps ensure they all expire at the same time.
This makes two significant changes:
- Hard fail if called with an invalid sticker pack URL. (All callers
check this already, so this should have no user impact.)
- Uses `URLComponents` to parse the fragment instead of a custom decoder
We should debug-fail when someone at Signal has made a mistake. If a
user clicks a bogus sticker pack link, nobody at Signal has made a
mistake, so we should warn instead.
This change should have no user impact, but makes it possible to write
tests for invalid cases.
This converts `PhoneNumberUtil.countryNameFromCountryCode`,
`PhoneNumberUtil.countryCodesForSearchTerm`, and `PhoneNumberUtil.name`
to Swift. I renamed `PhoneNumberUtil.name` to `does` for clarity, and
made it private.
This also lets us remove several utility methods.
This was partly done in 6e6327b007. The
server now [hard-codes this capability to `true`][0] so it's completely
useless for us to set it.
[0]: fb4ed20ff5