Commit a20e01c
fix: Order of messages if outgoing reply is received earlier (#7169)
This fixes a scenario when an outgoing reply is received earlier than an incoming message for some
reason like device B having `MvboxMove` enabled, sending the reply and going offline immediately, so
the reply is in Inbox and it's processed by device A earlier because e.g. `MvboxMove` is disabled on
it. Also if we add multi-transport later, this scenario will be just normal.
This allows received outgoing messages to mingle with fresh incoming ones, i.e. sorts them together
purely by timestamp by assigning `InFresh` state to received outgoing messages, but still returning
`OutDelivered` by all APIs for compatibility. NB: We already do such a trick for `OutMdnRcvd`.
As for messages sent locally, there's no need to make them more noticeable even if they are newer,
so received outgoing messages are always added after them.1 parent 5c36843 commit a20e01c
File tree
5 files changed
+30
-17
lines changed- src
- events
- tests
- test-data/golden
5 files changed
+30
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| |||
551 | 552 | | |
552 | 553 | | |
553 | 554 | | |
| 555 | + | |
554 | 556 | | |
555 | 557 | | |
556 | 558 | | |
557 | 559 | | |
558 | 560 | | |
559 | 561 | | |
560 | 562 | | |
561 | | - | |
| 563 | + | |
562 | 564 | | |
563 | 565 | | |
564 | 566 | | |
565 | 567 | | |
566 | 568 | | |
567 | 569 | | |
568 | 570 | | |
569 | | - | |
| 571 | + | |
570 | 572 | | |
571 | 573 | | |
572 | 574 | | |
| |||
1410 | 1412 | | |
1411 | 1413 | | |
1412 | 1414 | | |
1413 | | - | |
1414 | | - | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
1415 | 1423 | | |
1416 | | - | |
| 1424 | + | |
1417 | 1425 | | |
1418 | 1426 | | |
1419 | 1427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1692 | 1692 | | |
1693 | 1693 | | |
1694 | 1694 | | |
1695 | | - | |
| 1695 | + | |
1696 | 1696 | | |
1697 | 1697 | | |
1698 | 1698 | | |
1699 | 1699 | | |
1700 | 1700 | | |
1701 | 1701 | | |
1702 | 1702 | | |
1703 | | - | |
1704 | 1703 | | |
1705 | 1704 | | |
1706 | 1705 | | |
| |||
1997 | 1996 | | |
1998 | 1997 | | |
1999 | 1998 | | |
2000 | | - | |
| 1999 | + | |
2001 | 2000 | | |
2002 | 2001 | | |
2003 | 2002 | | |
| |||
2109 | 2108 | | |
2110 | 2109 | | |
2111 | 2110 | | |
| 2111 | + | |
| 2112 | + | |
2112 | 2113 | | |
2113 | 2114 | | |
2114 | 2115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
261 | | - | |
262 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
293 | 297 | | |
294 | 298 | | |
295 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
| 4 | + | |
5 | 5 | | |
0 commit comments