dm3-org / dm3

The dm3 protocol | New standard of web3 messaging | Decentralized ENS-based registry | Secure end-to-end encryption | Easy dApp integration
https://dm3.network
BSD 2-Clause "Simplified" License
76 stars 18 forks source link

Client sometimes sends 2 read receipts #1169

Closed malteish closed 1 month ago

malteish commented 1 month ago

While monitoring the use of handleSubmitMessage, I noticed that a message "Hi" from Alice to Bob usually results in 3 invokations of the endpoint:

  1. payload
  2. deliveryReceipt
  3. readReceipt (This assumes both Alice and Bob use the same delivery service)

However, sometimes handleSubmitMessage is invoked 4 times. This is the case when Bob is connected, but viewing another conversation. When switching tabs to the conversation with Alice, handleSubmitMessage is called 2 times. It should only be called once.