Commit Graph

23 Commits

Author SHA1 Message Date
Sasha Weiss
6ff76dd7e6
Do away with some ObjC test infra 2024-05-06 09:57:21 -07:00
Max Radermacher
dc7bc27dad
Use TimeGatedBatch for MSL cleanup 2023-12-04 13:25:39 -06:00
Max Radermacher
da3ae3edc2
Don’t put messages sent to PNIs in the MSL 2023-09-08 00:32:51 -05:00
Max Radermacher
b103f3d939
[ServiceId] Update outgoing messages 2023-08-17 11:09:00 -05:00
Max Radermacher
b593cba603
Adopt randomForTesting/constantForTesting 2023-07-26 16:29:14 -05:00
Max Radermacher
31f2f3d681
Improve MSL performance 2023-04-25 14:13:59 -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
Evan Hahn
a066511a62 Remove useless test setup/teardown
We had a lot of functions like this, which are useless:

    override func setUp() {
        super.setUp()
    }

This removes them.
2022-10-04 14:06:34 -07:00
Nora Trapp
7bd167f815
Initial story sending support
* Little fix for context menu

* Add 'My Stories' section to stories tab

* Add new story thread types

* Show stories in conversation picker

* Support for sending stories

* Update story list when sending stories

* Add basic 'My Stories' view controller

* Initial stories settings screens

* Consolidate TSPrivateStoryThread and TSMyStoryThread into one class

* Require an explicit read transaction to initialize an outgoing message

* Fix linting

* Allow enabling group story from internal settings

* Fix tests

* PR Feedback
2022-06-10 22:28:03 -04:00
Michelle Linington
d54d654cfc PR Feedback: Remove notImplemented altogether 2022-04-13 20:21:47 -07:00
Michelle Linington
6b2f8d31d6 Lint 2022-04-13 20:21:46 -07:00
Michelle Linington
cca09295e6 Adopt notImplemented() where it's unadopted
notImplemented() ends up forwarding to fatalError() anyway, but before
it does so it flushes our logs. That's probably good to have. I think
most of these come from the default implementations Xcode provides for
you with a fix-it.
2022-04-13 20:21:46 -07:00
Dimitris Apostolou
62724cf0be Fix typos 2022-03-18 11:31:06 -07:00
Michelle Linington
a74f22cfca Fix compilation issue in tests 2021-10-28 12:40:56 -07:00
Michelle Linington
65601d227e Fixes a couple of sender key issues:
- Failed sender key sends weren't properly retrying
- Spurious asserts when a delivery receipt for a sent message arrives
  before we finish the send
2021-10-28 12:40:56 -07:00
Michelle Linington
c7fb7b2032 Fix broken test 2021-09-01 11:42:34 -07:00
Michelle Linington
8bcf7d39ff Timestamp mismatch between envelope inside and outside
On a resend response, when fetching the proto payload from the MSL, some
incorrect float math led to an off-by-one timestamp for some timestamps.

One example is the timestamp 1629210680140. When converting to a date:
1629210680140 / 1000.0 = 1629210680.1399999

Then when converting back to milliseconds:
Int(1629210680.1399999 * 1000.0) = 1629210680139

To fix this, the MSL now only operates with UInt64 millisecond
timestamps.
2021-08-19 17:01:05 -07:00
Michelle Linington
6417494bc3 Fix tests 2021-08-19 16:54:29 -07:00
Michelle Linington
8ced863098 Fix a bug with date comparison. Added tests 2021-08-16 13:14:19 -07:00
Michelle Linington
c1f80c143d Lint 2021-08-16 13:14:19 -07:00
Michelle Linington
93d584b239 IOS-1718: Foreign constraint failure on MessageSendLog
Fixes a bug where a incoming delivery receipt can race with an
in-progress send.

- When a message is preparing to be sent, a payload is inserted
- As sends are successful, recipient entries are added to indicate that
  we're awaiting delivery acknowledgement.
- Once all recipient entries have been cleared (every recipient has
  acked), we delete the payload.

If a message is being sent to A and B: A succeeds, but B is delayed, and
A acks before B can be sent, the payload entry will be cleared.

This change adds a "sendComplete" bit to the MSL table to indicate
whether or not the entry should be preserved even if all recipients have
acked.
2021-08-16 13:14:19 -07:00
Michelle Linington
4952320106 Fix comment 2021-07-29 20:39:06 -07:00
Michelle Linington
4c3e30ea4b Add tests to exercise the MessageSendLog 2021-07-29 20:37:21 -07:00