Commit Graph

8519 Commits

Author SHA1 Message Date
Evan Hahn
15c27437e9
Remove websocket feature flag
This change should have no user impact.

This has been enabled for almost a year (see
1ef694e241). Let's assume it's always
enabled and remove it.
2023-03-21 09:28:45 -07:00
Evan Hahn
319582e7cb
Use unsigned ints for PIN attempts
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.
2023-03-21 08:57:26 -07:00
Evan Hahn
98ba4e3023
Add skeleton account data export screen 2023-03-21 08:37:59 -05:00
Evan Hahn
a77b45c6de Remove Dependencies from the three launch jobs
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.
2023-03-20 11:01:29 -05:00
Evan Hahn
63bdeb5cf4
Update SignalCoreKit to get Guarantee's nilTimeout
See [the SignalCoreKit commit][0] we're pulling in.

[0]: 75f61972e0
2023-03-20 08:11:24 -05:00
Harry
5ad17c4f2d
Support change number in registration coordinator
* 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
2023-03-17 17:55:06 -07:00
Harry
fbd00c88b1
guard usernames megaphone on usernames feature flag 2023-03-17 10:25:25 -07:00
Harry
19b38be2d0
Write string e164 to request params 2023-03-16 16:19:19 -07:00
Harry
8f8e74e2b5
Update message processor suspension-related behavior
* use set of enums for message suspensions

* Update meaning of isDrainingPendingEnvelopes

* rename messageProcessorDidFlushQueue -> ...DidDrainQueue
2023-03-16 14:23:10 -07:00
Harry
e6e4502363
Update RegCoordinator's requests in preparation for pni change number
* 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
2023-03-16 13:59:50 -07:00
Harry
5d8b3a0098
Add ChangePhoneNumberPniManagerMock 2023-03-16 12:40:09 -07:00
Harry
a31fb00368
Change all e164 references in reg coordinator to E164 type 2023-03-16 11:32:13 -07:00
Max Radermacher
6640819e46 Fix missing selector when sending messages 2023-03-16 11:31:04 -07:00
Harry
be743e4862
remove unused transaction param on pni change number 2023-03-16 11:27:49 -07:00
Max Radermacher
22d23b688a Refactor common logic in SignalServiceAddressTest 2023-03-15 17:10:10 -07:00
Evan Hahn
0b11f3be3c
Compute bench message a little later
This change should have no user impact. All I did was move some lines
down.
2023-03-15 11:53:32 -07:00
Evan Hahn
91c841dc3c Merge redundant callingCode(fromCountryCode:) tests
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.
2023-03-15 12:41:19 -05:00
Sasha Weiss
f20a663db8
Revert line that caused reentrant transactions 2023-03-14 17:44:48 -07:00
Sasha Weiss
8047472f68
Rename SubscriptionManagerProtocol 2023-03-14 17:44:38 -07:00
sashaweiss-signal
a83448c26a Rename KeyBackupServiceProtocol file 2023-03-14 16:43:53 -07:00
sashaweiss-signal
bec300c253 Rename KeyBackupService file 2023-03-14 16:43:53 -07:00
Sasha Weiss
367fdd769c
Rename KeyBackupServiceProtocol 2023-03-14 16:29:21 -07:00
Max Radermacher
fce10e3724 Fix warning about code that won’t be executed 2023-03-14 13:31:30 -07:00
Max Radermacher
7995da98bd Fix warning about var that could be let 2023-03-14 13:31:30 -07:00
Max Radermacher
82ffd842d0 Fix warning about unnecessary access specifier 2023-03-14 13:31:30 -07:00
Sasha Weiss
81b6201a03
Rename KeyValueStoreProtocol -> KeyValueStore 2023-03-14 13:26:06 -07:00
Harry
ac9a68688c
Set registration recovery password in AccountAttributes
* 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
2023-03-14 13:11:09 -07:00
Harry
8ca2d81d27
Add mcc/mnc to registration session if available 2023-03-14 12:41:31 -07:00
Pete Walters
3e3e0e5acf
Add manager to periodically validate usernames 2023-03-14 09:56:08 -05:00
Sasha Weiss
b0c629c9a8
Add required e164 to WhoAmI and ChangeNumber responses 2023-03-13 14:58:42 -07:00
Harry
6aa8a40381
Fix scheduling issue in ChangeNumberPniManager 2023-03-10 16:19:24 -08:00
Sasha Weiss
3897c706ce
Consolidate complete-change and update-state 2023-03-10 15:18:08 -08:00
Harry
feeabc2ba8
Catch re-entrant MockDBv2 transactions in tests
* Catch re-entrant MockDBv2 transactions in tests

* Fix some promise + transaction issues in RegCoordinator

* undo dumdum changes; dont handle errors on a guarantee
2023-03-10 15:03:27 -08:00
Sasha Weiss
837c7776a8
Add tests for ChangePhoneNumberPniManagerImpl 2023-03-10 14:07:38 -08:00
Harry
a146e18aaf
Set up account state and exit registration
* 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
2023-03-09 21:54:51 -08:00
Sasha Weiss
cd67e81baa
Wire up PNI change-number to ChangePhoneNumber 2023-03-09 17:37:37 -08:00
Sasha Weiss
82fad84831
Initial implementation of PNI change-number 2023-03-09 17:13:16 -08:00
Evan Hahn
2d48da8a6d
Handle new registration push challenges 2023-03-09 15:54:47 -06:00
Evan Hahn
e871e20e07 Enable checkpoint_fullfsync database option
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
2023-03-09 14:43:51 -06:00
Max Radermacher
93d97da82b
Split “in progress” & “saved” voice message drafts 2023-03-08 15:31:56 -08:00
Max Radermacher
d96157d05c
Clean up ProxiedContentDownloader for GIPHY requests 2023-03-08 14:12:53 -08:00
Harry
4ca0f63d49
Handle 401s for REST message fetches
* Migrate WhoAmI request to swift and modernize

* Follow up REST 401s with v1/accounts/me to check if deregistered

* Update SignalServiceKit/src/Network/API/RESTNetworkManager.swift

Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>

* retain self strongly in network manager

* update comment

---------

Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>
2023-03-08 10:53:58 -08:00
Evan Hahn
941284f462
Add file, line, and function to database corruption error message
This change should have no user impact.
2023-03-08 10:55:50 -06:00
george-signal
40361f5ffe
Fix failure to send GIFs. 2023-03-06 16:20:51 -08:00
Evan Hahn
7deb93ee98 Test scheduler: handle advancement to current time or earlier
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.
2023-03-06 12:23:13 -06:00
Harry
8c42d66489
Wipe related state on RegCoordinator when session id changes
* Wipe related state on RegCoordinator when session id changes

* Update Signal/Registration/RegistrationCoordinatorImpl.swift

Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>

* Update Signal/Registration/RegistrationCoordinatorImpl.swift

Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>

---------

Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>
2023-03-06 09:50:18 -08:00
george-signal
ce18ac8d29
[All media] Add filtering to prerelease builds. 2023-03-03 15:55:13 -08:00
Max Radermacher
501016de87 Fix crash when forwarding message w/mentions 2023-03-03 00:09:19 -08:00
Max Radermacher
b2512dc85e
Add StorageServiceManager.waitForPendingRequests() 2023-03-01 13:07:38 -08:00
Evan Hahn
5a9fd597d0 Convert startup logging to Swift
This change should have no user impact.

This was a pretty mechanical change.
2023-03-01 08:29:44 -06:00