Commit graph

364 commits

Author SHA1 Message Date
Matthew Chen
535241ef9e Add test app context; use mock "document" and "shared data container" directories in tests, use mock keychain storage in tests. 2018-09-07 15:37:40 -04:00
Matthew Chen
399dd13cee Add test app context; use mock "document" and "shared data container" directories in tests, use mock keychain storage in tests. 2018-09-07 15:37:40 -04:00
Michael Kirk
c7662b5a86 Step 2/2 %s/OWSAssert/OWSAssertDebug for existing previous assert semantics
Going forward, we want to prefer safer asserts, but we don't want to blindly
apply crashing asserts across the codebase
2018-09-07 10:00:48 -06:00
Matthew Chen
f4d1f25656 Merge remote-tracking branch 'origin/release/2.29.1' 2018-09-04 09:27:41 -04:00
Michael Kirk
6821e4a3a5 Don't include invalid media in gallery 2018-08-30 19:21:45 -06:00
Matthew Chen
f473f60111 Apply OWS log functions in Objective-C. 2018-08-27 12:58:52 -04:00
Matthew Chen
cc5a480baa Apply OWS log functions in Objective-C. 2018-08-27 12:58:52 -04:00
Matthew Chen
03829779cc Apply OWS log functions in Objective-C. 2018-08-27 12:58:52 -04:00
Matthew Chen
c0d486b1f1 Apply OWS log functions in Objective-C. 2018-08-27 12:58:52 -04:00
Matthew Chen
3a50377902 Apply OWS log functions in Objective-C. 2018-08-27 12:58:52 -04:00
Matthew Chen
713606271c Rename fail macros in Obj-C. 2018-08-27 10:29:51 -04:00
Matthew Chen
5b50e81b4f Rename fail macros in Swift. 2018-08-27 10:27:48 -04:00
Matthew Chen
cf6f3841a8 Apply new Swift logging. 2018-08-27 10:02:28 -04:00
Michael Kirk
82e559d11b Use swift macros for main thread assert 2018-08-23 10:29:49 -06:00
Matthew Chen
b347c40c66 Clean up ahead of PR. 2018-08-16 12:21:03 -04:00
Matthew Chen
0a7b3537b5 Recreate message database view when message mappings are corrupt. 2018-08-16 12:21:03 -04:00
Michael Kirk
c05700fd98 Log in OWSFail
step 1: rename OWSFail->OWSFailNoProdLog
step 2: rename OWSProdLogAndFail->OWSFail
step 3: Convert OWSFailNoProdLog->OWSFail where we want logging
step 4: Rename OWSCFail->OWSCFailNoProdLog
step 5: Rename OWSProdLogAndCFail -> OWSCFail
step 6: Convert OWSCFailNoProdLog -> OWSCFail where we want logging
2018-08-09 15:30:19 -06:00
Matthew Chen
db3df249bf Merge NSData categories. 2018-08-09 13:50:55 -04:00
Matthew Chen
2c9c028504 Clean up. 2018-08-09 09:51:23 -06:00
Matthew Chen
45e782c243 Revamp orphan data cleaner. 2018-08-07 13:07:26 -04:00
Michael Kirk
fc1ce02ae5 CR: Now that we have transaction semantics, this shouldn't happen.
// FREEBIE
2018-08-03 14:10:46 -06:00
Michael Kirk
1eb7fc986c YapDB introduced a method purpose built to do what we were approximating.
This seems a little more future proof / less error prone if we change the
registered extensions.
2018-08-03 14:09:35 -06:00
Michael Kirk
df01c7e63e Update to latest YapDB (with Signal patches applied)
Applied branches:

- mkirk/invalidFinalIndices
- mkirk/upstream-unencrypted-headers

Also fixed up test suite.
2018-08-03 14:09:35 -06:00
Matthew Chen
708ef6f7dd Fix NPE using mock for unknown database objects. 2018-07-23 16:42:11 -04:00
Matthew Chen
060e0fd062 Fix NPE using mock for unknown database objects. 2018-07-23 16:40:01 -04:00
Matthew Chen
03e5d2973b Delta contact intersections. 2018-07-18 14:27:40 -04:00
Michael Kirk
77997639f5 Use CurrentAppContext instead of compiler flag to affect test behavior 2018-07-18 10:24:08 -06:00
Michael Kirk
12ef25420a Fixup SSK tests 2018-07-17 19:32:44 -06:00
Michael Kirk
d591fb7f2c Fix some compiler warnings 2018-07-17 19:22:58 -06:00
Matthew Chen
158aa3abc4 Tweak system messages; incomplete vs. missed calls. 2018-07-11 15:34:16 -04:00
Matthew Chen
a6dbb7704a Remove overzealous assert in search finder. 2018-06-26 12:47:21 -06:00
Matthew Chen
700e9fa491 Improve logging around deserialization exceptions. 2018-06-22 09:49:57 -04:00
Michael Kirk
737598c731 Return unknown object from deserializer
// FREEBIE
2018-06-21 10:40:33 -06:00
Matthew Chen
4abaed0e6d Tidy up type checking in database views. 2018-06-20 17:09:14 -04:00
Matthew Chen
2e6b4899a7 Remove TSRecipient. 2018-06-20 16:36:43 -04:00
Matthew Chen
21a9ce3b20 Ensure TSRecipient can be deserialized. 2018-06-20 16:36:43 -04:00
Matthew Chen
f1708c0b30 Improve logging around deserialization failures. 2018-06-20 16:36:43 -04:00
Matthew Chen
28047abb6a Tweak database reset. 2018-06-20 14:46:45 -04:00
Matthew Chen
40e5bcc23f Respond to CR. 2018-06-15 10:03:15 -04:00
Matthew Chen
e8d0d9ecc0 Index oversize text for search. 2018-06-15 10:03:15 -04:00
Matthew Chen
f8e785ef72 Merge tag '2.26.0.25' 2018-06-15 09:59:45 -04:00
Michael Kirk
a91b6b35e2 update UI DB to latest before showing CVC
// FREEBIE
2018-06-14 18:23:13 -04:00
Matthew Chen
c8f2201a37 Respond to CR. 2018-06-14 16:33:27 -04:00
Matthew Chen
527e2715d4 Elaborate the search tests. 2018-06-14 16:18:13 -04:00
Matthew Chen
5c42e4c59e Improve search query construction. 2018-06-14 16:18:13 -04:00
Matthew Chen
755d30254e Improve search query construction. 2018-06-14 16:18:13 -04:00
Matthew Chen
153f3fc0a5 Improve search query construction. 2018-06-14 16:18:13 -04:00
Matthew Chen
a51e9b78b0 Improve search query construction. 2018-06-14 16:18:13 -04:00
Matthew Chen
f5a5d84edc Filter search index text. 2018-06-14 16:18:13 -04:00
Matthew Chen
b5e0265758 Filter search index text. 2018-06-14 16:18:13 -04:00
Matthew Chen
c8fee4efa7 Add swift logging to SSK. 2018-06-13 13:56:55 -04:00
Matthew Chen
44b23d44fd Respond to CR. 2018-06-13 12:40:34 -04:00
Michael Kirk
dff8d7bf97 Moving code around
// FREEBIE
2018-06-12 15:58:35 -04:00
Michael Kirk
f57a5dbc77 Match searches for national number format
// FREEBIE
2018-06-12 15:27:13 -04:00
Michael Kirk
fff8474150 adapt to rebase conflicts 2018-06-11 13:52:59 -04:00
Michael Kirk
f415827da6 Contact search results
// FREEBIE
2018-06-11 13:51:29 -04:00
Michael Kirk
729befa5cb CR: Cap max search results
// FREEBIE
2018-06-11 11:09:53 -04:00
Michael Kirk
b3705196b3 remove unused code/comments 2018-06-11 10:14:48 -04:00
Michael Kirk
13c43c2520 search groups by member name, cleanup tests
// FREEBIE
2018-06-11 09:58:36 -04:00
Michael Kirk
3a03c4f74c WIP: message indexing 2018-06-11 09:58:36 -04:00
Michael Kirk
b00e5a4fd9 Fuzzier search matching
-[] Backend
  -[] indexes e5.25
    -[x] wire up results: Contacts / Conversations / Messages actual: 3hr
    -[ ] group thread est: actual:
      -[x] group name actual: e.25
      -[ ] group member name: e.25
      -[ ] group member number: e.25
    -[ ] contact thread e.5
      -[ ] name
      -[ ] number
    -[ ] messages e1
      -[ ] content
-[] Frontend e10.75
  -[x] wire up VC's a.5
  -[x] show search results only when search box has content a.25
  -[] show search results: Contact / Conversation / Messages e2
   -[x] wire up matchs
   -[] style contact cell
   -[] style conversation cell
   -[] style messages cell
  -[] tapping thread search result takes you to conversation e1
  -[] tapping message search result takes you to message e1
  -[] show snippet text for matched message e1
  -[] highlight matched text in thread e3
  -[] go to next search result in thread e2
  -[] No Results page
  -[] Hide search unless pulled down
2018-06-11 09:58:36 -04:00
Michael Kirk
a9e2834d9f WIP: FTS - rudimentary show results
-[] Backend
  -[] indexes e5.25
    -[x] wire up results: Contacts / Conversations / Messages actual: 3hr
    -[ ] group thread est: actual:
      -[x] group name actual: e.25
      -[ ] group member name: e.25
      -[ ] group member number: e.25
    -[ ] contact thread e.5
      -[ ] name
      -[ ] number
    -[ ] messages e1
      -[ ] content
-[] Frontend e10.75
  -[x] wire up VC's a.5
  -[x] show search results only when search box has content a.25
  -[] show search results: Contact / Conversation / Messages e2
   -[x] wire up matchs
   -[] style contact cell
   -[] style conversation cell
   -[] style messages cell
  -[] tapping thread search result takes you to conversation e1
  -[] tapping message search result takes you to message e1
  -[] show snippet text for matched message e1
  -[] highlight matched text in thread e3
  -[] go to next search result in thread e2
  -[] No Results page
  -[] Hide search unless pulled down
2018-06-11 09:58:36 -04:00
Michael Kirk
7df158120b Fix build warnings: mark initWithCoder as designated.
// FREEBIE
2018-06-11 09:56:14 -04:00
Michael Kirk
00f8ea4ff8 Use a single ui connection to share cache.
Primarly two things:
1. using an extension for the first time per connection is slow
2. fetching the same objects (e.g. if you leave/re-enter the same
conversation)

// FREEBIE
2018-06-01 13:16:43 -04:00
Matthew Chen
3cd6a33aa6 Fix build warnings. 2018-06-01 12:39:13 -04:00
Matthew Chen
d62725d3b7 Add reported application state. 2018-05-31 16:31:51 -04:00
Michael Kirk
a10ae1835e respond to code review
// FREEBIE
2018-05-07 12:51:55 -04:00
Michael Kirk
5ba5e98260 Show downloaded contact avatar in thread
// FREEBIE
2018-05-07 12:08:41 -04:00
Michael Kirk
7a1d24a9ab Avatar updates when contact/profile/group photo changes
// FREEBIE
2018-04-26 11:18:18 -04:00
Matthew Chen
aa35594ad5 Respond to CR. 2018-04-25 09:30:23 -04:00
Matthew Chen
67f2d6608f Detect and handle corrupt database views. 2018-04-25 09:30:23 -04:00
Matthew Chen
1a4c01ae29 Detect and handle corrupt database views. 2018-04-25 09:30:23 -04:00
Matthew Chen
212891c50d Detect and handle corrupt database views. 2018-04-25 09:30:23 -04:00
Matthew Chen
f70a45ef1b Clean up ahead of PR. 2018-04-25 09:30:23 -04:00
Matthew Chen
50a59c907d Detect and handle corrupt database views. 2018-04-25 09:30:23 -04:00
Matthew Chen
d3b484482c Detect and handle corrupt database views. 2018-04-25 09:30:23 -04:00
Matthew Chen
7f23dfa258 Respond to CR. 2018-04-24 13:15:11 -04:00
Matthew Chen
2265ae08aa Don't start app version migrations until storage is ready. 2018-04-24 11:56:32 -04:00
Michael Kirk
b3cd6a112b Add OWSJanksUI assertion
// FREEBIE
2018-04-21 20:00:56 -04:00
Michael Kirk
897d4a925b HomeView caches thread models
// FREEBIE
2018-04-21 19:21:18 -04:00
Michael Kirk
1fb1b5bbe2 WIP unjank home screen
verify `description` isn't used elsewhere (notifications? conversation
view?)

Probably want to remove overzealous asserts for now, but would be good
to work towards leaving them enabled.

// FREEBIE
2018-04-21 19:21:18 -04:00
Matthew Chen
35ee8c1a0d Rework flush of registration connection(s). 2018-04-18 17:38:13 -04:00
Matthew Chen
a264268253 Rework flush of registration connection(s). 2018-04-18 17:38:13 -04:00
Matthew Chen
e1138df771 Rework flush of registration connection(s). 2018-04-18 17:38:13 -04:00
Matthew Chen
5bbce14020 Rework flush of registration connection(s). 2018-04-18 17:38:13 -04:00
Matthew Chen
5d627ee89f Rework flush of registration connection(s). 2018-04-18 17:38:13 -04:00
Matthew Chen
4f1f1a107f Rework flush of registration connection(s). 2018-04-18 17:38:13 -04:00
Matthew Chen
65015e686f Tap on quoted replies. 2018-04-10 15:54:46 -04:00
Michael Kirk
622f6bdf21 OrphanDataCleaner vs. QuotedAttachment thumbnails
// FREEBIE
2018-04-09 12:47:56 -04:00
Matthew Chen
4915c127cb Rework quoted reply debug UI. 2018-04-02 16:17:46 -04:00
Matthew Chen
9dfc955ee5 Fix flush of registration connections. 2018-04-02 12:20:30 -04:00
Matthew Chen
684614013e Revert "Fix flush of registration connections."
This reverts commit 52b238c499.
2018-04-02 12:20:05 -04:00
Matthew Chen
52b238c499 Fix flush of registration connections. 2018-04-02 11:32:24 -04:00
Matthew Chen
4602ad9014 Respond to CR. 2018-04-02 09:39:13 -04:00
Matthew Chen
1dced463cb Lazy restore attachments. 2018-04-02 09:28:12 -04:00
Matthew Chen
61dc2c0249 Add local cache of backup fragment metadata. 2018-04-02 09:27:34 -04:00
Matthew Chen
e88f5643f7 Add local cache of backup fragment metadata. 2018-04-02 09:27:34 -04:00
Matthew Chen
d0c691bb7f Lazy attachment restores. 2018-04-02 09:27:34 -04:00
Matthew Chen
610bbacd21 Clean up ahead of PR. 2018-03-20 11:23:56 -04:00
Matthew Chen
0c81d5656f Rework database snapshot representation, encryption, etc. 2018-03-20 11:23:56 -04:00
Matthew Chen
1bbd41f725 Improve perf of database snapshots. 2018-03-20 11:23:56 -04:00
Michael Kirk
a0bd2c2324 OrphanDataCleaner shouldn't delete active thumbnails
// FREEBIE
2018-03-19 14:22:03 -04:00
Michael Kirk
dfd628250d Gallery performance
- [x] share uiDatabaseConnection to share cache
- [x] increase cache size
- [x] load less initially
- [x] lazy loading
  - [x] slider view
  - [x] tile view

// FREEBIE
2018-03-19 14:22:03 -04:00
Michael Kirk
4ac9a1019b Media page view controller
First pass at a swipe-through media view for conversations.

Future work could include

- title label per item
  - sender name
  - date/time
- photo rail
- include caption

// FREEBIE
2018-03-16 15:55:34 -04:00
Matthew Chen
4746948dfe Respond to CR. 2018-03-14 10:02:44 -03:00
Matthew Chen
3f822e8ce3 Complete minimal backup MVP. 2018-03-14 09:27:39 -03:00
Matthew Chen
0971bad4b2 Upload database and manifest files to CloudKit. 2018-03-12 16:40:07 -03:00
Matthew Chen
c84bf81cf3 Export database for backup. 2018-03-12 16:40:07 -03:00
Matthew Chen
46a89e89f0 Sketch out OWSBackupStorage. 2018-03-12 16:40:06 -03:00
Matthew Chen
792be8018f Incremental backup. 2018-03-12 16:40:06 -03:00
Matthew Chen
692ef423be Rename TSStorageManager to OWSPrimaryStorage. 2018-03-06 17:12:13 -03:00
Matthew Chen
d6f4db1523 Rename TSStorageManager to OWSPrimaryStorage. 2018-03-06 17:12:13 -03:00
Michael Kirk
1d3831eccd Registration Lock reminder view
Also fixed: Don't lose PIN across registrations

// FREEBIE
2018-03-05 09:53:09 -05:00
Michael Kirk
54792ff461 Fix overzealous assert.
Sometimes we set values to nil - e.g. when re-registering through
debugUI

// FREEBIE
2018-03-05 09:37:26 -05:00
Matthew Chen
59c745756a Clean up codebase. 2018-03-02 15:05:14 -05:00
Matthew Chen
e12a1e984a Work on two-factor auth settings UI. 2018-03-01 15:38:59 -05:00
Matthew Chen
59f480d5c4 Use background tasks during storage registration and disappearing message jobs. 2018-02-27 08:42:30 -05:00
Matthew Chen
4e1e232825 Flush writes from other processes. 2018-02-22 11:46:08 -05:00
Matthew Chen
3bb802189c Use background tasks during db transactions. 2018-02-21 16:10:55 -05:00
Matthew Chen
706006539f Improve the robustness of the migration logic. 2018-02-20 20:16:12 -05:00
Matthew Chen
d91507d897 Improve the robustness of the migration logic. 2018-02-20 17:37:14 -05:00
Matthew Chen
9295a56309 Elaborate logging around storage migration. 2018-02-20 16:25:15 -05:00
Michael Kirk
033505afd7 Remove slow file protection updates from launch path
To avoid blocking launch, file protection is now updated async for most
moved files. Out of paranoia, the database files are also update
redundantly on a sync code path.

It's still critical that we update permissions recursively for two
reasons:

1. Updating a containing directories FileProtection does not affect
   existing files in that directory.

2. Because we've changed the containers default file protection level
   (from unspecified to NSFileProtectionComplete), some existing files
   will have there file protection updated upon launching Signal 2.20.
   It's not clear to me which files this affects, and I haven't found
   any relevant documentation, but from observation, it seems to affect
   any top-level files in the container. Regardless, we're now doing the
   right thing: after launching 2.20, ensure all file permissions are
   what we expect.

Also removed no-op file protection on legacy db files. They've already
been moved by the time this method runs in AppSetup.

// FREEBIE
2018-02-18 16:24:29 -05:00
Michael Kirk
3d5f7e6bf3 Clean up logging
- tag all log lines for easier filtering
- use up-to-date database path

// FREEBIE
2018-02-14 09:16:42 -08:00
Matthew Chen
ba42ac73d8 Revisit TODOs in the SAE work. 2018-02-12 22:33:26 -05:00
Matthew Chen
b64528e817 Respond to CR. 2018-02-09 10:42:25 -05:00
Matthew Chen
bd0f601792 Respond to CR. 2018-02-09 10:31:29 -05:00
Matthew Chen
38950ae2ed Respond to CR. 2018-02-09 10:31:29 -05:00
Matthew Chen
6b357f9445 Respond to CR. 2018-02-09 10:31:29 -05:00
Matthew Chen
43765ef3b5 Respond to CR. 2018-02-09 10:31:29 -05:00
Matthew Chen
7d3f79440f Clean up ahead of PR. 2018-02-09 10:31:29 -05:00
Matthew Chen
bbd689bfd0 Add protocol context to protocol kit. 2018-02-09 10:31:29 -05:00
Matthew Chen
074046b98e Add protocol context to protocol kit. 2018-02-09 10:31:29 -05:00
Matthew Chen
7358f3053f Add protocol context to protocol kit. 2018-02-09 10:31:29 -05:00
Matthew Chen
39e353503f Add protocol context to protocol kit. 2018-02-09 10:31:29 -05:00
Matthew Chen
71782e0369 Add protocol context to protocol kit. 2018-02-09 10:31:29 -05:00
Matthew Chen
122ef91e57 Add protocol context to protocol kit. 2018-02-09 10:31:29 -05:00
Michael Kirk
4f8db63fb3 Ensure keyspec is generated before DB is created
// FREEBIE
2018-01-31 18:05:44 -08:00
Michael Kirk
6f959ff292 CR: be more conservative about deriving key spec, clear old passphrase
after deriving key spec.

// FREEBIE
2018-01-31 17:22:42 -08:00
Michael Kirk
d22fc664f2 more granular key access
// FREEBIE
2018-01-31 16:08:03 -08:00
Michael Kirk
426c9baa16 Key material changes
- For new installs, generate raw key-spec rather than derive it
- Adapt to separated concerns of the key derivation migration from the unencrypted header migration
- Reduce number of places where we delete/generate keying information
- Only store relevant keying material

// FREEBIE
2018-01-31 16:08:03 -08:00
Michael Kirk
938b9c85b8 Don't crash on clean install
Otherwise we'll error when retrieving non-existent password.

// FREEBIE
2018-01-31 13:28:14 -08:00
Matthew Chen
4bfdef520a Respond to CR. 2018-01-30 12:39:27 -05:00
Matthew Chen
963d0547ad Clean up ahead of PR. 2018-01-30 10:31:13 -05:00
Matthew Chen
ebbe96a5d5 Clean up ahead of PR. 2018-01-30 10:31:13 -05:00
Matthew Chen
6eddfae214 Improve post-migration testing tools. 2018-01-30 10:31:13 -05:00
matthew chen
8325c37191 Fix build breakage. 2018-01-30 10:30:28 -05:00
matthew chen
873c789132 Fix build breakage. 2018-01-30 10:30:28 -05:00
Matthew Chen
b9ec7d96e9 Register all database views asynchronously. 2018-01-30 10:30:28 -05:00
Matthew Chen
aeeef43416 Register all database views asynchronously. 2018-01-30 10:30:28 -05:00