Commit Graph

32 Commits

Author SHA1 Message Date
Max Radermacher
0a24b7b357
Clean up recipient searches 2024-03-07 11:57:45 -06:00
Max Radermacher
422c0f03ba
Don’t migrate kLocalProfileUniqueId user profiles 2024-02-16 16:36:07 -06:00
Max Radermacher
cebe9b0f40
Remove redundant phone numbers from database 2024-02-14 19:08:40 -06:00
Max Radermacher
ded1d2f5b8
Assume everybody is PNI-capable 2024-02-13 14:53:39 -06:00
Max Radermacher
d51102c461
Delete expired messages in smaller batches 2023-12-04 11:40:11 -06:00
Sasha Weiss
43256c85e8
Add extension for sqliteRowId 2023-10-13 15:17:54 -07:00
Harry
aa0e250cb7
[Death to TSAccountManager, long live TSAccountManager][9] Migrate usages of old TSAccountManager to new 2023-10-05 08:56:08 -07:00
Sasha Weiss
c39af86c22
Catch retained transactions in MockDB 2023-08-30 12:39:26 -07:00
Max Radermacher
30adac30ab
Reduce size of CDS write transactions 2023-08-18 12:27:15 -05:00
Max Radermacher
29472146a2
[ServiceId] Update outgoing receipts 2023-08-17 12:10:58 -05:00
Max Radermacher
ac14bc637e
[ServiceId] Update TSIncomingMessageBuilder 2023-08-02 17:40:56 -05:00
Max Radermacher
46f8d6cb56
[ServiceId] Update reactions 2023-08-02 17:14:52 -05:00
Max Radermacher
17a2fb4093
Rename ServiceId -> UntypedServiceId 2023-07-26 16:56:19 -05:00
Max Radermacher
b593cba603
Adopt randomForTesting/constantForTesting 2023-07-26 16:29:14 -05:00
Max Radermacher
5acabbe61f
Prepare interactions for modern recipient merging 2023-06-28 11:58:44 -05:00
Pete Walters
9b235845ed
Update how edits are expired & deleted 2023-06-02 16:15:46 -05:00
Pete Walters
f58b6947ce
Funnel read crashes into the recovery flow 2023-06-02 11:48:51 -05:00
Max Radermacher
28753eb98b Add & use ThreadReplyInfoStore 2023-05-31 11:34:43 -05:00
Sasha Weiss
f1063c1071
Migrate OWSDevice to SDSCodableModel 2023-04-13 14:00:46 -07:00
Sasha Weiss
c9fbc9a9ee
Migrate SSKJobRecord and subclasses to SDSCodableModel using factory init 2023-04-13 10:57:48 -07:00
Evan Hahn
2895b84ef1
Database recovery: REINDEX as a first step
*I recommend reviewing this with whitespace changes disabled.*
2023-04-05 15:21:16 -05:00
Max Radermacher
93d97da82b
Split “in progress” & “saved” voice message drafts 2023-03-08 15:31:56 -08:00
Harry
3d6225060d
Add RegistrationCoordinator
* 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
2023-02-14 08:50:24 -08:00
Harry
fc4ec188e8
Implement RegistrationSessionManager
* Add RegistrationSession object

* Add RegistrationSessionManager protocol

* Add skeleton RegistrationSessionManagerImpl - just kvstore persistence implemented

* Issue requests in RegistrationSessionManagerImpl

* let tests access the in memory kv store

* Add TSRequestOWSURLSessionMock. Rename OWSURLSessionMock

* Add DateProvider

* Take a dateProvider in RegistrationSessionManagerImpl

* Add tests for RegistrationSessionManager

* pre-emptively update timeout for tests. will remove once promise Scheduler code is merged

* PR comments

* Use Schedulers
2023-02-08 15:37:12 -08:00
Sasha Weiss
e5f1af6c2e
Support lookup-by-username 2023-02-08 10:16:57 -08:00
Evan Hahn
b95a1c4363
Make FullTextSearchFinder stateless
This change should have no user impact. I think this is a useful
cleanup.
2023-02-06 13:33:43 -06:00
Harry
6576349613
Migrate KeyBackupService to the Swift Way™️
* 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
2023-02-02 09:42:05 -08:00
Evan Hahn
1ba45411ae
Enable a RingRTC field trial for all users, with kill switch
The successor to 389515b0fa.

This enables the "WebRTC-Network-UseNWPathMonitor" RingRTC field trial
for all users.

The hard part: adding a remote config kill switch. I added a bunch of
comments (and tests) to try to make the intention clear.
2023-02-01 16:20:16 -06:00
Evan Hahn
370ff654e7
Change license to AGPL
Change license to AGPL

This commit:

- Updates the `LICENSE` file

- Start every file with something like:

      // Copyright YEAR_FIRST_PUBLISHED Signal Messenger, LLC
      // SPDX-License-Identifier: AGPL-3.0-only

---

First, I removed existing license headers with this Ruby 3.1.2 script:

    require 'set'

    EXTENSIONS_TO_CHECK = Set['.h', '.hpp', '.cpp', '.m', '.mm', '.pch', '.swift']

    same = 0
    different = 0

    all_files = `git ls-files`.lines.map { |line| line.strip }
    all_files.each do |relative_path|
      if relative_path == 'Pods'
        next
      end

      unless EXTENSIONS_TO_CHECK.include? File.extname(relative_path)
        next
      end

      path = File.expand_path(relative_path)

      contents = File.read(path)
      new_contents = contents.sub(/\/\/\n\/\/  Copyright .*\n\/\/\n\n/, '')

      if contents == new_contents
        same += 1
      else
        different += 1
      end

      File.write(path, new_contents)
    end

    puts "updated #{different} file(s), left #{same} untouched"

I'm sure this script could be improved, but it worked well enough.

Then, I created `Scripts/lint/lint-license-headers` and ran it to auto-
fix a lot of files. This changed the mode of some files, but I think
that's actually desirable. For example,
`SignalServiceKit/src/Util/AppContext.m` previously had a mode of
`0755/-rwxr-xr-x`, and it's now `0644/-rw-r--r--`.

Then I fixed some stragglers and updated the precommit script.

See [a similar change in the Desktop app][0].

[0]: 8bfaf598af
2022-10-13 08:25:37 -05:00
Evan Hahn
349681ff85
Attempt to recover corrupted databases
If a user's database is corrupted, we now try to fix it. I recommend
reviewing `DatabaseRecovery` to see how this works, and
`DatabaseRecoveryViewController` for the bulk of the UI.
2022-10-06 16:42:19 -05:00
Evan Hahn
4da042c1d5
Clean up database corruption storage code
_This change should have no user impact._

The database corruption flag lives on `UserDefaults`. Currently, this
flag is controlled through `SSKPreferences`, but I kinda think that's
the wrong place—database corruption isn't really a user preference.

This moves it into its own file, tests it, and [drops booleans in favor
of an enum][0]. I think this is useful on its own, but also prepares us
for an upcoming change.

[0]: https://www.luu.io/posts/dont-use-booleans
2022-09-23 18:19:02 +00:00
Evan Hahn
11c2cf0813
Add basic test for database migration
_This change should have no user impact._

This adds a basic test for database migration, and makes the necessary
changes to make that possible.
2022-09-22 17:24:40 +00:00