Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More permanent and correct solution to old notifications #2671

Open
corrideat opened this issue Feb 25, 2025 · 0 comments
Open

More permanent and correct solution to old notifications #2671

corrideat opened this issue Feb 25, 2025 · 0 comments

Comments

@corrideat
Copy link
Member

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 }) 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:

  1. 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).
  2. messageReceivePostEffect checks if the message height is higher than this value before emitting a notification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant