Commit Graph

7703 Commits

Author SHA1 Message Date
Michelle Linington
2e7671b3f5 More project cleanup 2022-04-20 16:26:54 -07:00
Evan Hahn
0cf8a30bf9 Test Subscription struct
This test-only change adds tests for [`Subscription`][0].

I did this because I'll be adding additional behavior to this struct and
want to be ready to test that logic. I think this is a useful change on
its own, however, so I split it out into its own change.

[0]: 2693c55232/SignalMessaging/Subscriptions/SubscriptionManager.swift (L70-L104)
2022-04-20 12:47:50 -05:00
Evan Hahn
636b417390 Upgrade GRDB to version 5.23.0
This upgrades [GRDB][0] from v4.3.0 to v5.23.0, the latest version.

I closely followed the [migration guide][1] and stole from a prior
attempt at this upgrade. I also made sure to test the media gallery,
because that allegedly had problems before.

[0]: https://github.com/groue/GRDB.swift
[1]: 6d3f309cad/Documentation/GRDB5MigrationGuide.md
2022-04-20 09:08:50 -05:00
Martin Böttcher
9f66cce5e1 made iterating job records more stable 2022-04-19 19:47:44 +02:00
Martin Böttcher
04892da490 error iterating job records does not crash the app anymore 2022-04-19 19:47:44 +02:00
Evan Hahn
ef6c044a54 Remove legacy donation view
_I recommend reviewing this with whitespace changes disabled._

We have a kill switch that disables badge acquisition. If that kill
switch is active, we show a one-time donation view.

That kill switch has been off since January of 2021, so I think we can
remove this one-time donation view. That lets us remove hundreds of
lines of code, but it will also make future donation-related changes a
bit easier.
2022-04-19 10:46:04 -05:00
Jordan Rose
c8de10815a Remove internal lock from OWSIdentityManager
This isn't protecting any local state and wasn't being used
consistently, and it can result in lock inversion deadlocks if
-readWithUnfairLock: is called within a database write transaction.
2022-04-18 18:19:31 -07:00
Jordan Rose
a61088b76f Add "Export Database" to the internal settings, for debugging 2022-04-18 17:36:42 -07:00
Max Radermacher
bc53916301 Convert all(Testable)?Flags to functions 2022-04-18 16:28:01 -07:00
Max Radermacher
a353e8d757 free() the result of class_copyPropertyList
The docs say that the caller must `free()` the result.
2022-04-18 14:52:26 -07:00
Max Radermacher
c097b1189c Extract allPropertyNames from allFlags
This isolates all of the Obj-C runtime code in its own function.

If a class doesn’t have any properties, `class_copyPropertyList` may
return `NULL`. Previously, this would have resulted in an error while
force unwrapping the result, but all `BaseFlags` subclasses have
properties, so that wasn’t a problem in practice. Now, an empty array
will be returned, which seems correct when there aren’t any properties.
2022-04-18 14:52:26 -07:00
Max Radermacher
05b0112c88 Rename buildFlagMap()allFlags
This matches the naming scheme used for `allFeatureFlags`.
2022-04-18 14:52:26 -07:00
Max Radermacher
91512d745c Don’t pass class or value lookup block
The class can be computed from `self`, and the lookup block is always
the same (essentially `self.value(forKey:)`), so there’s no need to
provide separate implementations for each subclass. The superclass can
provide a single implementation for all subclasses to share.
2022-04-18 14:52:26 -07:00
Max Radermacher
ad8ab4a386 Implement findTestableFlags via buildFlagMap
The testable flags are a subset of all flags, so call the existing code.

This will cause the flags to be returned in an arbitrary order, but that
is fine since they’re only used in [one place][1], and that place sorts
the results before using them.

[1]: c77939a907/Signal/src/ViewControllers/AppSettings/Internal/TestingViewController.swift (L45-L48)
2022-04-18 14:52:26 -07:00
Max Radermacher
450b8035f3 Add unit tests for BaseFlags’ reflection APIs 2022-04-18 14:52:26 -07:00
Nora Trapp
27e03b6a70 Render 1:1 story replies 2022-04-15 19:28:14 -07:00
Jordan Rose
9132234a54 Fix for non-messages being filtered out of interaction results
Messages always have an isGroupStoryReply of true or false (1 or 0),
but non-messages don't have this field, and GRDB treats that as NULL
rather than falling back to the table default.
2022-04-15 15:42:33 -07:00
Michelle Linington
41f78c5d12 Merge branch 'release/5.35.1' 2022-04-14 18:16:01 -07:00
Michelle Linington
54ea65a01d "Feature flags for .qa." 2022-04-14 18:07:44 -07:00
Michelle Linington
cef393b7e1 "Feature flags for .beta." 2022-04-14 18:07:38 -07:00
Michelle Linington
5e521962b2 "Feature flags for .production." 2022-04-14 17:02:03 -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
Jordan Rose
f58ab2ae07 Separate IdentityStore from IdentityManager
*Most* of the identity store's duties are about the identity keys of
people you talk to, but it also provides the local identity key (and
registration ID), and the local identity key differs by PNI.

This design fetches the local identity key up front in preparation for
supporting Change Number flows better, where you may need to use a
past PNI identity key to decrypt a message. (That's just one possible
implementation strategy, though.)
2022-04-14 16:47:46 -07:00
Michelle Linington
e22bfcdc9b Add some version comparison tests 2022-04-14 16:44:16 -07:00
Michelle Linington
488259d5ef Lint 2022-04-14 16:25:33 -07:00
Michelle Linington
c19fa8b950 Improve log cleanup on launch 2022-04-14 16:23:21 -07:00
Evan Hahn
aaf070b7e9 Merge branch 'release/5.35.1' 2022-04-14 14:30:25 -05:00
Evan Hahn
48b9147da4 "Feature flags for .qa." 2022-04-14 14:17:46 -05:00
Evan Hahn
a30be64720 "Feature flags for .beta." 2022-04-14 14:17:29 -05:00
Evan Hahn
bf826b7743 "Feature flags for .production." 2022-04-14 14:16:31 -05:00
Evan Hahn
68b6f92367 Improve handling of database errors 2022-04-14 13:14:30 -05: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
Michelle Linington
23b802bd7f Merge branch 'release/5.35.0' 2022-04-12 23:09:14 -07:00
Michelle Linington
a61fac1543 "Feature flags for .qa." 2022-04-12 23:04:27 -07:00
Michelle Linington
7699c9fa9a "Feature flags for .beta." 2022-04-12 23:04:21 -07:00
Michelle Linington
39e0169094 "Feature flags for .production." 2022-04-12 23:03:15 -07:00
Nora Trapp
6c0d44e8cd Enable stories migration 1 2022-04-12 22:56:18 -07:00
Michelle Linington
8af12b1165 Merge branch 'release/5.35.0' 2022-04-12 18:02:07 -07:00
Igor Solomennikov
81169c245e Use switch{} instead of several if's. 2022-04-12 17:38:21 -07:00
Igor Solomennikov
bd653bee3b Lint. 2022-04-12 17:38:21 -07:00
Igor Solomennikov
25810e0887 Add OWSFormatTest. 2022-04-12 17:38:21 -07:00
Igor Solomennikov
2128a2f7f2 Lint. 2022-04-12 17:38:21 -07:00
Igor Solomennikov
56217c1c7b Add methods for convert TimeInterval and Int into localized string.
• OWSFormat.localizedDecimalString(from:) would convert Int into
  a localized string using `decimal` style (preferred style for displaying
  in the UI).
• OWSFormat.localizedDurationString(from:) would convert a time interval
  into localized string like "HH:mm:ss", using current locale.
2022-04-12 17:38:21 -07:00
Michelle Linington
160b44ef97 "Feature flags for .qa." 2022-04-12 17:23:52 -07:00
Michelle Linington
597c2fb1d1 "Feature flags for .beta." 2022-04-12 17:23:47 -07:00
Michelle Linington
7286bafdd3 "Feature flags for .production." 2022-04-12 17:23:38 -07:00
Michelle Linington
4e9d564b36 Move initial block sync off main thread 2022-04-12 17:10:50 -07:00
Evan Hahn
b743b4efc7 Remove donation receipts feature flag
As we discussed, let's remove this flag and just release normally.
2022-04-12 13:38:12 -05:00