matrix-org / matrix-org/matrix-js-sdk

Does _notifTimelineSet only store and notify highlighted events?

Open
#808 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

T-Other
Dominant language
TypeScript
Stars
2.2k
Forks
704
Avg merge
1d 20h
Merged PRs (30d)
40

Description

I am trying to do the notification stuffs and I found that the client has a TimelineSet call `_notifTimelineSet`, I looked into the code and found that only highlighted events would be added to this queue:

https://github.com/matrix-org/matrix-js-sdk/blob/76c675cd09685664bc63883a881eed8808b3911f/src/sync.js#L1535-L1539

However we might expect 2 cases normally:
1. The room is not muted, all the events (might be filtered later) would be notified;
2. The room is muted, only highlighted events (e.g. m.alert events) would be notified.

And I also check the `matrix-react-sdk`, it processes the events for notification in a more reasonable way (however it does not use `_notifTimelineSet` either):

```Javascript
_evaluateEvent: function(ev) {
const room = MatrixClientPeg.get().getRoom(ev.getRoomId());
const actions = MatrixClientPeg.get().getPushActionsForEvent(ev);
if (actions && actions.notify) {
if (this.isEnabled()) {
this._displayPopupNotification(ev, room);
}
if (actions.tweaks.sound && this.isAudioEnabled()) {
PlatformPeg.get().loudNotification(ev, room);
this._playAudioNotification(ev, room);
}
}
},
```

https://github.com/matrix-org/matrix-react-sdk/blob/37c984e1955185fc1d915b8620ec506dad177959/src/Notifier.js#L288-L300

Please correct me if I misunderstood the purpose of the `_notifTimelineSet`.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/sync.js at lines 1535-1539 and compare its _notifTimelineSet usage with matrix-react-sdk's src/Notifier.js at lines 288-300. Determine the intended notification semantics for muted and unmuted rooms, then confirm whether the current behavior is intentional or needs a maintainer decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.