Introduction fails after deleting and re-adding contact
This was reported by a friend of @grote.
Steps to reproduce:
- Set up fresh accounts for Alice, Bob and Carol
- Carol signs out and plays no further role
- Put Bob into airplane mode and turn off Bluetooth
- Wait until Alice sees Bob as offline
- Alice asks to introduce Bob to Carol
- Alice and Bob remove each other as contacts
- Take Bob out of airplane mode
- Alice asks to introduce Bob to Carol again
- Alice sees the second introduction request as received (two check marks)
- Alice sends a private message to Bob
- Alice sees the private message as received
Expected result:
- Bob sees Alice's introduction request and private message
Actual result:
- Bob only sees Alice's private message
The suspected cause is that Alice's second introduction request depends on the first request, because Alice (in the introducer role) doesn't delete the last local message ID from the session when removing Bob as a contact. Bob no longer has a copy of Alice's first request, so the second request is never delivered to the client layer. But Alice sees the second request as received because it's acked by the sync layer.