-
Notifications
You must be signed in to change notification settings - Fork 270
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
Handle more notification edge cases (get_notification_item
et al.)
#2179
Comments
I want the edge cases list to be as exhaustive as possible so that we can think about all of them. Update the original issue if you see more. |
matrix-org/synapse#15246 is affecting how we can display notifications for invites, since the |
Summarizing the content of our discussion with Manu. Running a As such, the following edge cases could not be handled:
Some ideas for technical workarounds:
|
So @poljar suggested in chat that there was another way to get the latest room avatar / name, without resorting to using the same state store (so no shared caching possible, still):
Not only it would fill more information, but it'd also handle invites properly, and it would be more efficient than the current set of requests we're running. |
thanks @poljar for the idea. From a design point of view, it could help to have the same behavior on iOS and android (or, more generally, multi-process and single process envs). We could have the same logic on both platforms with iOS using an in-memory state store and android, the "normal" state store. |
get_notification_item
get_notification_item
et al.)
Interesting idea, but I wonder if that would be subpar for Android, where we could reuse the same state store without worrying about concurrent cross-process writes. |
Should be fixed by #2252 which introduced We have some weird edge cases to handle by #2330, like receiving a notification while the app was in airplane mode; the sliding sync may not find the event (as it may have happened hours before), in which case we'll use a That being said, most of the work here is done, so closing. |
The
get_notification_item
fn is currently based on a simple/event
call. It only manages the happy path where we already have data in the cache.We are managing the case where we do not have the keys in cache yet but there are other use cases we must address. I am listing below all use cases I see even if they may have a common technical solution.
Room not yet loaded in the app
In this situation, the room state can miss. This creates those problems:
Room cache not update
Display names and avatars can have been changed elsewhere
get_notification_item
must get the latest profile info to render the notification in an accurate wayPush rules update
A user can update their notification settings from another client. If they disabled one type of push elsewhere, they expect all clients to stop notifying.
get_notification_item
must check push rules on the latest push rulesFuture
Coming features that worth considering for the implementation
/sync
to get event content, an event could have been already fetched and cached by a previous call ofget_notification_item
Related tasks
push_actions
ofTimelineEvent
do not work properly in a sliding sync context #2159The text was updated successfully, but these errors were encountered: