Commit Graph

10 Commits

Author SHA1 Message Date
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