You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #2629, notification sounds were played when joining a chatroom (for old messages). This was addressed by calling sbp('chelonia/contract/isSyncing', contractID, { firstSync: true }) in messageReceivePostEffect.
This works most of the time, but it's not perfect. For example, it will result in those same sounds being played if the initial contract sync gets interrupted.
Solution
A more permanent and correct solution could be as follows:
When joining a chatroom, the device takes note of the latest height and stores it. Note: this is a per-device setting, distinct from the information that's part of the contract state. This is only done once (per join, i.e., leaving and re-joining resets this height, but otherwise it doesn't get updated).
messageReceivePostEffect checks if the message height is higher than this value before emitting a notification.
The text was updated successfully, but these errors were encountered:
Problem
In #2629, notification sounds were played when joining a chatroom (for old messages). This was addressed by calling
sbp('chelonia/contract/isSyncing', contractID, { firstSync: true })
inmessageReceivePostEffect
.This works most of the time, but it's not perfect. For example, it will result in those same sounds being played if the initial contract sync gets interrupted.
Solution
A more permanent and correct solution could be as follows:
messageReceivePostEffect
checks if the message height is higher than this value before emitting a notification.The text was updated successfully, but these errors were encountered: