Commit Graph

26 Commits

Author SHA1 Message Date
Sasha Weiss
2845d60e13
Remove lots of GV1-related code 2023-06-01 11:47:43 -07:00
Max Radermacher
fc9b8349fe Improve reliability of database-related tests 2023-04-17 14:10:40 -07:00
Max Radermacher
dfabf88f0c Don’t inherit from SSKBaseTestSwift unless needed 2023-04-07 10:09:32 -07: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
Max Radermacher
974b643234
Reduce likelihood of flaky test failures 2022-10-07 09:36:04 -07:00
Harry
7ee39eef63
Add SystemStoryManager
* Add OnboardingStoryManager

* mark onboarding story viewed

* Add tests and fix issues that came up from testing

* up test timeout for slower CI

* rename SystemStoryManager and put into dependency injecton container

* Use viewed state on StoryMessage itself. Have SystemStoryManager observe app lifecyle events to automatically manage the onboarding story

* use iOS assets which are now in s3

* todo cleanup

* increment timestamp for uniqueness

* pr comments

* change literal delimiter

* Add ChainedPromise utility, tests, and use in SystemStoryManager

* discretionarily observe app backgrounding in SystemStoryManager

* renaming from PR comments
2022-08-30 14:49:59 -07:00
Evan Hahn
92ef1610fc Actually run OutgoingGroupUpdateMessageTest
I added these tests in da322d3bf9 but
didn't actually add them to the project! This adds them and runs them.
2022-08-25 11:14:49 -05:00
Jordan Rose
a301452f0c Test phone number sharing modes for sealed sender
Sealed sender certificates come in two flavors: one with our local
phone number, and one without. Add an automated test for picking the
right one based on our phone number sharing mode (everybody,
contacts-only, nobody).

This commit also adds a convenience helper for tests that want to wait
on promises that might run on the main thread.
2022-05-18 10:21:53 -07:00
Jordan Rose
a2edd320bb OWSMessageDecrypter should use destinationUuid to choose local stores
Note that on its own this doesn't change behavior of the app;
OWSMessageProcessor still drops non-ACI messages even attempting to
decrypt them.
2022-04-14 16:47:46 -07:00
Matthew Chen
86b8eb08b8 Remove YapDatabase.
Apply asset from design.

Fix rebase breakage.
2021-03-25 11:41:16 -03:00
Matthew Chen
d0cbf8cfd0 Rework dependency access. 2021-03-25 09:24:27 -03:00
Jordan Rose
75f179f572 SSK: Flush DispatchQueue.main after every test
There are a lot of events that get dispatched onto the main queue
(often /from/ the main queue), and processing them during the setup
for the subsequent test can cause problems. In particular, the
notification for setting up a local number in -[OWSMessageManagerTest
test_GroupUpdate] was occasionally being processed in the subsequent
-test_GroupUpdateWithAvatar, depending on how long GRDB took to set up
in the second test.
2021-01-14 16:37:53 -08:00
Matthew Chen
4c6f2c22b4 Use protocol contexts in prekey stores. 2020-08-25 21:31:56 -03:00
Matthew Chen
7298549e98 Resolve issues related to groups v2 in test suites. 2020-06-04 09:40:38 -03:00
Michael Kirk
d024ed99c0 Use appropriate sender certificate depending on capabilities 2020-01-31 20:33:57 -07:00
Matthew Chen
14435d91b4 Fix rebase breakage. 2019-08-26 13:18:49 -03:00
Matthew Chen
c2ae2037d4 Fix rebase breakage. 2019-08-26 13:18:49 -03:00
Matthew Chen
79b1d31f20 Don't load YDB unless necessary.
Don't load YDB unless necessary.

Don't load YDB unless necessary.

Don't load YDB unless necessary.
2019-08-26 13:18:30 -03:00
Matthew Chen
8ca337e2c3 Rework generic change observation. 2019-08-13 09:58:27 -03:00
Michael Kirk
691209e25e Decrypt Messages with AnyTransaction
- Migrate protocol stores to KVStores
- Introduce AnyDatabaseQueue
- Move messaging pipeline to AnyTransactions
- Migrate specialized PushDecrypt job to generic JobQueue
2019-05-21 16:20:22 -04:00
Michael Kirk
46bb9de67e clear grdb between tests in SSK tests too 2019-05-14 15:10:02 -06:00
Michael Kirk
c309c57c4c reset grdb between tests 2019-05-14 15:10:02 -06:00
Michael Kirk
662955832d fix jobqueue tests 2019-05-14 09:30:26 -06:00
Matthew Chen
c6ef7f18e7 Improve test logging. 2018-10-16 13:01:24 -04:00
Matthew Chen
03f23b5f79 Fix breakage in UD manager; add UD manager test, hang TSAccountManager on SSKEnv, fix bugs in tests. 2018-10-11 08:46:24 -04:00
Matthew Chen
7fd15d2fd9 Add server certificate methods to UD manager. 2018-10-02 13:24:00 -04:00