Commit graph

63 commits

Author SHA1 Message Date
Matthew Chen
a0c13490ca Clean up ahead of PR.
// FREEBIE
2017-05-12 09:49:51 -04:00
Matthew Chen
6e52009ff0 Rework the “disappearing messages” logic.
// FREEBIE
2017-05-10 14:54:15 -04:00
Michael Kirk
a92129a0ee better sending logs
// FREEBIE
2017-05-04 09:43:13 -04:00
Matthew Chen
b986db808d Add filename to attachment streams. 2017-04-26 11:07:42 -04:00
Matthew Chen
b40ec508b6 Do not retry fatal message send errors.
// FREEBIE
2017-04-19 18:52:28 -04:00
Matthew Chen
9b24ad7f14 Do not try to resend unsaved outgoing messages when accepting a safety number change.
// FREEBIE
2017-04-19 15:17:56 -04:00
Matthew Chen
a3db112c50 Fix outgoing message status for messages sent from linked devices.
// FREEBIE
2017-04-18 21:45:33 -04:00
Matthew Chen
6341905c9b Respond to CR.
// FREEBIE
2017-04-17 16:45:22 -04:00
Matthew Chen
ced9d6f460 Retry group sends if any of its errors are re-tryable.
// FREEBIE
2017-04-17 16:11:51 -04:00
Matthew Chen
aa70ada399 Refine error handling for outgoing group messages.
// FREEBIE
2017-04-17 16:11:51 -04:00
Matthew Chen
db051b3b3e Consider group send a failure if sending to any member in the group fails.
// FREEBIE
2017-04-17 16:11:51 -04:00
Matthew Chen
04dc930e0c Rework outgoing message state.
// FREEBIE
2017-04-17 16:11:51 -04:00
Matthew Chen
0ab6bcd080 Rework outgoing message state.
// FREEBIE
2017-04-17 16:11:51 -04:00
Matthew Chen
40dcc7c873 Honor attachment filenames.
// FREEBIE
2017-04-13 15:41:39 -04:00
Matthew Chen
17b751d22a Create block offer when non-contacts send you a message.
// FREEBIE
2017-04-12 08:38:46 -04:00
Matthew Chen
004a952bc0 Respond to CR.
// FREEBIE
2017-04-10 12:35:30 -04:00
Matthew Chen
8258f26aec Don’t mark messages as failed until all retries are exhausted.
// FREEBIE
2017-04-10 10:35:43 -04:00
Michael Kirk
97f93eef7e only assert queues in debug
// FREEBIE
2017-04-07 12:46:42 -04:00
Michael Kirk
2d93b8c6ec Handle mismatched/stale devices on session queue
The session state should never be manipulated concurrently.

// FREEBIE
2017-04-06 19:11:04 -04:00
Michael Kirk
7578176e37 rename sessionCipher to sessionStoreQueue
// FREEBIE
2017-04-06 16:29:12 -04:00
Michael Kirk
60dcadb0d7 Move iOS Versions from Signal-iOS
// FREEBIE
2017-04-06 16:26:19 -04:00
Michael Kirk
fcf271f08b Block list is two words
// FREEBIE
2017-04-05 17:34:47 -04:00
Michael Kirk
fa9e289892 Don't retry some failures
Motivation:

When we introduced the MessageSendingOperation, we included a new
"retry" loop. However, this had some unintended consequences when
retrying terminal failures.

Some of these are pretty benign and invisible to the user, but some,
like messaging someone who's safety number has changed, results in a
situation where we get rate-limited by the pre-key request.

Description:

This commit includes the machinery to distinguish between retryable and
terminal failures. Upon reporting a terminal failure, the MessageSender
stops retrying to send.

// FREEBIE
2017-04-05 11:30:41 -04:00
Matthew Chen
b12e93076e Don’t block outgoing group messages.
// FREEBIE
2017-04-03 14:45:09 -04:00
Matthew Chen
723174e14e Respond to CR.
// FREEBIE
2017-04-03 14:42:04 -04:00
Matthew Chen
d47ddd112d Filter outgoing messages using the blacklist.
// FREEBIE
2017-04-03 14:30:15 -04:00
Matthew Chen
e038d24103 Apply assert to ensure singletons are only created once.
// FREEBIE
2017-03-31 18:45:46 -04:00
Michael Kirk
f005b66fa5 code review: move unnecessary __block allocation
// FREEBIE
2017-03-24 16:29:58 -04:00
Matthew Chen
a730381424 Fix crash writing a "swift" NSData on iOS 9.
// FREEBIE
2017-03-24 14:39:10 -04:00
Matthew Chen
607dd9a2f2 Avoid YapDatabase deadlock in OWSMessageSender.
// FREEBIE
2017-03-23 17:14:16 -04:00
Matthew Chen
5739f71bd4 Respond to CR.
// FREEBIE
2017-03-23 14:35:30 -04:00
Matthew Chen
c3d2ea7abd Use a separate sending queue for each conversation.
// FREEBIE
2017-03-23 12:45:02 -04:00
Matthew Chen
62d52ce9a0 Fix “send to self operations never complete” issue.
// FREEBIE
2017-03-23 11:05:49 -04:00
Michael Kirk
29a0597b0c Only call sendMessage on main thread.
The proximate cause for this change was a failing assert in the recently
introduced call to `setBackgroundTaskIdentifier` which is synchronized
on the main thread.

But generally, to keep things simple, we prefer calling back on main
thread unless performance dictates otherwise.

// FREEBIE
2017-03-20 15:59:45 -04:00
Michael Kirk
58829e2162 ensure we don't interrupt sending by being backgrounded
// FREEBIE
2017-03-20 15:00:09 -04:00
Michael Kirk
e68ee28e51 Add clarifying asserts per code review
// FREEBIE
2017-03-20 14:57:05 -04:00
Michael Kirk
db15ff5e87 Save message before sending starts.
Otherwise the message doesn't get saved until it's in the queue.
Interestingly, this could also address some of the perceived lag
mentioned in: https://github.com/WhisperSystems/Signal-iOS/pull/1850

// FREEBIE
2017-03-20 14:53:42 -04:00
Michael Kirk
df51523a84 Serialize message sending and generalized retry logic.
Previously messages could be sent out of order if (e.g.)

1. You're on a slow network
2. You send a big attachment
3. You immediately send text

Generally in this scenario, the text will be sent before the attachment.

Also, introduced a more general retry loop to retry on *any* failure
during sending.

Previously the only retry logic was around the messages API on the
Signal Server.

Now we'll also retry failures when allocating an attachment, or
uploading an attachment.

TODO: remove the now redundant retry logic in the message sender?

TODO: there is still one place where we send messages directly through
the MessageSender, rather than via the operation - when resending to a
group due to a safety number change. This is separate logic because we
were being sure to *only* resend to that one recipient. Cleaning this up
would move a lot of code around.

Once Signal-Desktop implements timestamp based de-duping we could shave
that wart by having this troublesome codepath use NSOperation like
everything else.

// FREEBIE
2017-03-20 14:53:42 -04:00
Matthew Chen
958dbd199b Minor clean up.
// FREEBIE
2017-03-14 13:34:20 -03:00
Michael Kirk
975726e022 Dedupe incoming messags
// FREEBIE
2017-02-24 19:15:35 -08:00
Matthew Chen
351a010fe0 Clean up prekey usage.
// FREEBIE
2017-02-14 13:39:52 -05:00
Matthew Chen
821c96cc6b Mark "attempting out" messages as "unsent" on app launch.
// FREEBIE
2017-02-13 17:16:18 -05:00
Matthew Chen
284212b3fe Move OWSDispatch.h to the PCH.
// FREEBIE
2017-02-08 16:25:28 -05:00
Michael Kirk
80fb58231e Merge remote-tracking branch 'origin/master' into mkirk/webrtc
// FREEBIE
2017-02-01 20:01:22 -05:00
Michael Kirk
7b1b706e2a Include reusable localized text in recipient-not-found error
This way we can use it for calls as well.

// FREEBIE
2017-02-01 19:16:07 -05:00
Matthew Chen
ddbc4819f1 Rework concurrency in the signaling logic.
// FREEBIE
2017-02-01 10:21:50 -05:00
Michael Kirk
104645f97b Safely pass exception across dispatch bounds
// FREEBIE
2017-01-31 09:46:25 -05:00
Michael Kirk
cf6f107f1e Merge remote-tracking branch 'origin/master' into mkirk/webrtc
Get session corruption fixes

// FREEBIE
2017-01-25 11:33:07 -05:00
Michael Kirk
3216fd3714 Prevent session corruption by using same queue for encrypt vs. decrypt
// FREEBIE
2017-01-24 15:00:38 -05:00
Michael Kirk
d1aa253f87 WebRTC calling
* Stun server request
* settable TextSecureEnv
* nullability annotations for TSCall
* Better debug logging for message sending
* fixup tests and expiration time

// FREEBIE
2017-01-11 17:15:20 -05:00