mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Update messages uploaded to mailbox correctly
@@ -12,171 +12,50 @@ However, this is not strictly speaking necessary as all messages are treated the
|
||||
|
||||
Mailbox screens do not show any messages, therefore the user cannot know if their messages were correctly uploaded or not, either to their own or to the contact's mailbox. For the user, that is all black box, and they only see the clock, or one or two ticks below each message to tell them what the status of that message is.
|
||||
|
||||
Also at the moment, neither Briar nor Mailbox screens show to the user who 'knows' or 'dones't know' that a user may have linked and usable mailbox.
|
||||
A user will not know who of their contacts does or does not have a mailbox linked - they always only see the status of their messages via a clock icon (unsent message), one tick (sent but not acknowledged) or two ticks (send and acknowledged), and status of their contacts being reachable or not (green circle for reachable ones).
|
||||
|
||||
|
||||
|
||||
The expected results are defined here https://code.briarproject.org/briar/briar/-/wikis/Mailbox-Scenarios
|
||||
The expected results are defined here [Mailbox scenarios](https://code.briarproject.org/briar/briar/-/wikis/Mailbox-Scenarios)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Scenarios:
|
||||
|
||||
### Scenario 1: No mailbox
|
||||
When X has a mailbox, but Y doesn't yet know about X's mailbox:
|
||||
|
||||
In this scenario, two contacts (X and Y) communicate without a mailbox. While Y is offline, X writes a message to Y. The message is not sent (clock icon) until X and Y are online at the same time. When X and Y are online at the same time, the message is sent and acked (two ticks).
|
||||
* X will upload messages and acks for Y to X's mailbox
|
||||
* X will check X's mailbox for messages and acks uploaded by Y
|
||||
* Y won't upload anything to X's mailbox, or download anything from it, as Y doesn't yet know about X's mailbox
|
||||
* Communication via X's mailbox won't work in either direction
|
||||
* This problem will resolve itself when Y receives X's update informing Y about X's mailbox, which will happen the next time X and Y are online at the same time
|
||||
|
||||
### Scenario 2: X has a mailbox that Y doesn't know about
|
||||
|
||||
In this scenario, X and Y become contacts and then Y goes offline. While Y is offline, X links a mailbox (M). Y doesn't know about X's mailbox, because no connection has happened between X and Y since X linked the mailbox.
|
||||
|
||||
While Y is offline, X writes a message to Y. X's message is uploaded to X's mailbox (one tick). Then X goes offline and Y comes back online. Y doesn't download X's message from X's mailbox because Y doesn't know about the mailbox yet.
|
||||
|
||||
While X is offline, Y writes a message to X. Y's message is not uploaded to X's mailbox (clock icon), because Y doesn't know about the mailbox yet. Then X comes back online.
|
||||
|
||||
When X and Y are online at the same time, both messages are sent and acked (two ticks).
|
||||
|
||||
* Install Briar on X and Y
|
||||
* Add X and Y as contacts
|
||||
* In Briar's connection settings, turn off wifi and Bluetooth connections on X and Y
|
||||
* Take Y offline
|
||||
* Expectation: Y is shown as offline in X's contact list (after a delay of up to 1 minute for X to notice that Y is offline)
|
||||
* X writes a private message to Y
|
||||
* Expectation: X's message is shown as not sent (clock icon) in X's conversation screen
|
||||
* While keeping X online, bring Y back online
|
||||
* Install Mailbox on M
|
||||
* Link Briar running on X with Mailbox running on M
|
||||
* X writes a message to Y
|
||||
* Expectation: the message is shown as sent (one tick) in X's conversation screen (after a delay of up to 2 minutes for X to connect to M and upload the message)
|
||||
* Take X offline
|
||||
* Bring Y back online
|
||||
* Expectation: X is shown as offline in Y's contact list
|
||||
* Expectation: X's message does not appear in Y's conversation screen
|
||||
* Y writes a message to X
|
||||
* Expectation: Y's message is shown as not sent (clock icon) in Y's conversation screen
|
||||
* While keeping Y online, bring X back online
|
||||
* Expectation: X is shown as online in Y's contact list and vice versa (after a delay of up to 2 minutes for X and Y to connect to each other)
|
||||
* Expectation: X's message appears in Y's conversation screen
|
||||
* Expectation: X's message is shown as sent and acked (two ticks) in X's conversation screen
|
||||
|
||||
|
||||
(refer to: https://code.briarproject.org/briar/briar/-/wikis/Mailbox-Scenarios
|
||||
|
||||
When X has a mailbox, and Y knows about X's mailbox:
|
||||
|
||||
* X will upload messages and acks for Y to X's mailbox
|
||||
* Y will upload messages and acks for X to X's mailbox
|
||||
* X will check X's mailbox for messages and acks uploaded by Y
|
||||
* Y will check X's mailbox for messages and acks uploaded by X
|
||||
* Communication via X's mailbox will work in both directions
|
||||
|
||||
|
||||
**scenario 1A**
|
||||
- the sender is online, they have a mailbox on a device that is also online.
|
||||
-
|
||||
- The recipient is offline and they don't have a mailbox app.
|
||||
- The sender's message will be uploaded to their own mailbox, and at this point the sent message has one tick (this take a couple of minutes usually)
|
||||
- Then the sender's device needs to be put offline, to make sure that any messages that recipient may receive come to them from the sender's mailbox and not from the sender's Briar app
|
||||
- When the intended recipient comes online, the mailbox will forward them the message.
|
||||
- Recipient's briar app will generate the ack, and if the sender is online they will see two ticks on the message that they sent to recipient.
|
||||
-
|
||||
executed OK, briar build 7aafbdd7, mb build df779012, 23/8/2022
|
||||
|
||||
**scenario 1B**
|
||||
- Another possibility is if the sender is offline when the recipient generates the ack - this can be achieved after the message has been uploaded to the mailbox, but before the recipient comes online. In this case, only the device with sender's mailbox is online at one time.
|
||||
- Then the recipient comes online and receives the sender's message.
|
||||
- Their briar app generates the ack. As the sender is offline at present, that ack will simply wait for the sender to come online and will be sent when that happens.
|
||||
- When the sender comes online, they receive the ack from the recipient (who needs to be online at the same time)
|
||||
|
||||
executed OK, briar build 7aafbdd7, mb build df779012, 23/8/2022
|
||||
|
||||
**Scenario 2**
|
||||
|
||||
| sender | online | has mailbox | maibox online | recipient | online | has mailbox | maibox online |
|
||||
| ------ | ------ | ------ | ------ | ------ | ------ |------ | ------ |
|
||||
| ------ | yes | yes | no | ---- | no | no | na |
|
||||
|
||||
- This is a scenario where the sender has a mailbox app on another device, but that device is not initially online.
|
||||
**Scenario 2A**
|
||||
- the recipient is offline and they don't have the mailbox installed
|
||||
- sender wants to send a message to their contact who is offline, and as their mailbox is offline too, the message will just have a 'clock' icon, meaning, it has not been sent yet
|
||||
- then the sender's mailbox app comes online, and the message to the recipient is upoaded onto the sender's mailox (recipient is still offline at this point).
|
||||
- the message gets 'one tick'
|
||||
- now the sender goes offline
|
||||
- Then the recipient comes online, and they receive the message from the sender's mailbox (for the recipient, this is transparent, it is like any other message they receive from the sender, they don't know necesarily that this message has passed via mailbox)
|
||||
- The recipient's Briar app will generate and send the ack
|
||||
- this ack will be received by the sender when they come online again.
|
||||
|
||||
executed OK, briar build 7aafbdd7, mb build df779012, 23/8/2022
|
||||
|
||||
**Scenario 2B**
|
||||
|
||||
- Similar scenario, but the recipient comes online before the sender's mailbox does.
|
||||
- As soon as both the sender and recipient are online, the messages are exchanged between them direclty, without passing through mailbox.
|
||||
|
||||
- message in sender's Briar app gets the second tick
|
||||
- recipient now sends a reply message to the original sender.
|
||||
- their message arrives to the sender, whose briar app generates an immediate ack, and the reply message sent from recipient's briar app gets two ticks.
|
||||
- mailbox goes offline
|
||||
- sender replies to the reply they received, and the recipient receives it in a normal way
|
||||
|
||||
executed OK, briar build 7aafbdd7, mb build df779012, 23/8/2022
|
||||
|
||||
**Scenario 3**
|
||||
|
||||
| sender | online | has mailbox | maibox online | recipient | online | has mailbox | maibox online |
|
||||
| ------ | ------ | ------ | ------ | ------ | ------ |------ | ------ |
|
||||
| ------ | yes | yes | yes | ---- | no | yes| yes |
|
||||
|
||||
- This is a scenario where both the sender and the recipient have the mailbox app installed and paired with Briar, and both mailboxes are online at the same time.
|
||||
- initially, the sender is online
|
||||
- initially, the recipient is offline
|
||||
- sender sends a message to their contact who is offline
|
||||
- this message is uploaded to their own mailbox (and not the recipient's)
|
||||
- then sender goes offline
|
||||
- When the recipient comes online, they receive the message from sender's mailbox
|
||||
- Recipient's briar app generates ask and uploads it to their own mailbox
|
||||
- recipient goes offline
|
||||
- sender comes online, and they receive the ack from the recipient's mailbox
|
||||
- sender's initial message in their briar app gets the second tick
|
||||
- sender goes offline
|
||||
- recipient comes online and sends a reply message to the sender
|
||||
- this reply message gets uploaded to the recipient's mailbox
|
||||
|
||||
- sender's mailbox goes offline
|
||||
- when the sender gets back online they receive a message via recipient's mailbox
|
||||
|
||||
- sender's briar app generates an ack and sends it directly to the recipient who is still online (and does not upload it to the sender's mailbox)
|
||||
|
||||
executed OK, briar build 7aafbdd7, mb build df779012, 23/8/2022
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
**Scenario 4**
|
||||
|
||||
|
||||
| sender | online | has mailbox | maibox online | recipient | online | has mailbox | maibox online |
|
||||
| ------ | ------ | ------ | ------ | ------ | ------ |------ | ------ |
|
||||
| ------ | yes | no | na | ------ | no |yes | yes|
|
||||
|
||||
This is a scenario for cases where the sender doesn't have a mailbox, but the recipient has
|
||||
|
||||
- initially the sender is online and wants to message the recipient who is offline
|
||||
- the sender's message will get uploaded to the recipient's mailbox.
|
||||
- sender goes offline.
|
||||
- when the recipient comes online, the message is forwarded to them by their mailbox.
|
||||
- recipient's briar app generates the ack.
|
||||
- The ack is uploaded to the recipient's mailbox.
|
||||
- recipient goes offline.
|
||||
- the sender comes online and receives the ack from the recipient's mailbox.
|
||||
- recipient comes online.
|
||||
- now we have the sender, recipient and recipient's mailbox who are all online at the same time
|
||||
- recipient now replies to the message they received from the sender,
|
||||
- this message is delivered directly to the sender, without passing via recipient's mailbox - **TBD how this can be verified. Or does it even need to be verified?**
|
||||
- recipient who sent this message gets an immediate double tick in the briar app for that message
|
||||
|
||||
**Scenario 5**
|
||||
|
||||
| sender | online | has mailbox | maibox online | recipient | online | has mailbox | maibox online |
|
||||
| ------ | ------ | ------ | ------ | ------ | ------ |------ | ------ |
|
||||
| ------ | yes | yes | yes | ------ | no |yes | yes|
|
||||
|
||||
TBD what happens to the messages upoaded into the mailbox, but that get delivered directly to the briar app via BT? for example. Do those messages get purged from mailbox?
|
||||
|
||||
In this scenario
|
||||
- sender sends a message to a contact who is offline
|
||||
- their message gets uploaded to their mailbox as their contact is offline
|
||||
- then their contact comes near them and connects via BT
|
||||
****- TBD should the message (or messages) that was uploaded to mailbox now be resent to the same contact via BT?**
|
||||
- and the ack will also be delivered via BT
|
||||
- should the message be purged from Mailbox? (and how to verify this?)**
|
||||
|
||||
|
||||
|
||||
|
||||
* Expectation: Y's message appears in X's conversation screen
|
||||
* Expectation: Y's message is shown as sent and acked in Y's conversation screen
|
||||
|
||||
[Back to Testing](https://code.briarproject.org/briar/briar/-/wikis/Testing)
|
||||
|
||||
Reference in New Issue
Block a user