Also:
- Remove AtomicUInt's @objc, it's no longer used from ObjC
- Remove Codable conformances, they would implicitly use shared locks
and weren't used in practice
* 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
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
The gist is:
```diff
-foo = foo + 1
+foo += 1
```
Most of the violations were in generated files, so I changed and re-ran the generator.
A few of these violations required implementing some new methods, which I added tests for.
See [the docs for this rule][0].
[0]: https://realm.github.io/SwiftLint/shorthand_operator.html
- Move NSE notification waiter to be the very last thing we wait on.
This ensures that notifications enqueued while the message manager
handles messages make it to UserNotifications
- Current call can now be accessed off the main thread
- All group call message handling occurs off the main thread
Previously we only logged when everything was complete, or if we timed
out, but neither helps when tracking down memory overallocation
issues, since the NSE is killed before any of these logs print. With
this we have a better chance at seeing which jobs are outstanding.
- GiphyAPI kept no internal state, no need to instantiate a singleton
for it
- Better logging of what prevented us from completing our NSE wake
- Fixes a bug where we fail to generate sync messages in the NSE while
locked