Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Implement unread counter (MSC2625) #7673

Merged
merged 30 commits into from
Jun 17, 2020
Merged

Implement unread counter (MSC2625) #7673

merged 30 commits into from
Jun 17, 2020

Commits on Sep 18, 2019

  1. Add experimental "dont_push" push action to suppress push for notific…

    …ations
    
    This is a potential solution to https://github.com/vector-im/riot-web/issues/3374
    and element-hq/element-web#5953
    as raised by Mozilla at element-hq/element-web#10868.
    
    This lets you define a push rule action which increases the badge count (unread notification)
    count on a given room, but doesn't actually send a push for that notification via email or HTTP.
    We might want to define this as the default behaviour for group chats in future
    to solve https://github.com/vector-im/riot-web/issues/3268 at last.
    
    This is implemented as a string action rather than a tweak because:
     * Other pushers don't care about the tweak, given they won't ever get pushed
     * The DB can store the tweak more efficiently using the existing `notify` table.
     * It avoids breaking the default_notif/highlight_action optimisations.
    
    Clients which generate their own notifs (e.g. desktop notifs from Riot/Web
    would need to be aware of the new push action) to uphold it.
    
    An alternative way to do this would be to maintain a `msg_count` alongside
    `highlight_count` and `notification_count` in `unread_notifications` in sync responses.
    However, doing this by counting the rows in `events` since the `stream_position`
    of the user's last read receipt turns out to be painfully slow (~200ms), perhaps
    due to the size of the events table.  So instead, we use the highly optimised
    existing event_push_actions (and event_push_actions_staging) table to maintain
    the counts - using the code paths which already exist for tracking unread
    notification counts efficiently.  These queries are typically ~3ms or so.
    
    The biggest issues I see here are:
     * We're slightly repurposing the `notif` field on `event_push_actions` to
       track whether a given action actually sent a `push` or not.  This doesn't
       seem unreasonable, but it's slightly naughty given that previously the
       field explicitly tracked whether `notify` was true for the action (and
       as a result, it was uselessly always set to 1 in the DB).
     * We're going to put more load on the `event_push_actions` table for all the
       random group chats which people had previously muted. In practice i don't
       think there are many of these though.
     * There isn't an MSC for this yet (although this comment could become one).
    ara4n committed Sep 18, 2019
    Configuration menu
    Copy the full SHA
    2292dc3 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2019

  1. changelog

    ara4n committed Sep 19, 2019
    Configuration menu
    Copy the full SHA
    dd8e24f View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2020

  1. Configuration menu
    Copy the full SHA
    ec0a7b9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6f6a4bf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ef345c5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c7b99a1 View commit details
    Browse the repository at this point in the history
  5. Fix tests

    babolivier committed Jun 10, 2020
    Configuration menu
    Copy the full SHA
    476a897 View commit details
    Browse the repository at this point in the history
  6. Changelog

    babolivier committed Jun 10, 2020
    Configuration menu
    Copy the full SHA
    aad40e3 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    df3323a View commit details
    Browse the repository at this point in the history
  8. Lint

    babolivier committed Jun 10, 2020
    Configuration menu
    Copy the full SHA
    243f0ba View commit details
    Browse the repository at this point in the history
  9. Appease mypy

    babolivier committed Jun 10, 2020
    Configuration menu
    Copy the full SHA
    9dbd006 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2020

  1. Configuration menu
    Copy the full SHA
    ea8f6e6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ce74a66 View commit details
    Browse the repository at this point in the history
  3. Lint

    babolivier committed Jun 11, 2020
    Configuration menu
    Copy the full SHA
    d0f0956 View commit details
    Browse the repository at this point in the history
  4. Fix schema update

    babolivier committed Jun 11, 2020
    Configuration menu
    Copy the full SHA
    34fd1f7 View commit details
    Browse the repository at this point in the history
  5. Fix SQL

    babolivier committed Jun 11, 2020
    Configuration menu
    Copy the full SHA
    8032917 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    cb6d4d0 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2020

  1. Fix summary rotation

    babolivier committed Jun 12, 2020
    Configuration menu
    Copy the full SHA
    3cc7f43 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2a07c5d View commit details
    Browse the repository at this point in the history
  3. Remove debug logging

    babolivier committed Jun 12, 2020
    Configuration menu
    Copy the full SHA
    63d9a00 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6b1fa32 View commit details
    Browse the repository at this point in the history
  5. Lint

    babolivier committed Jun 12, 2020
    Configuration menu
    Copy the full SHA
    7e80c84 View commit details
    Browse the repository at this point in the history
  6. Use attr instead of a dict

    babolivier committed Jun 12, 2020
    Configuration menu
    Copy the full SHA
    cf92fbb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    9549d55 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1e5a503 View commit details
    Browse the repository at this point in the history
  9. Incorporate review bits

    babolivier committed Jun 12, 2020
    Configuration menu
    Copy the full SHA
    e47e5a2 View commit details
    Browse the repository at this point in the history
  10. Lint

    babolivier committed Jun 12, 2020
    Configuration menu
    Copy the full SHA
    e186c66 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2020

  1. Incorporate review

    babolivier committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    fed493c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c2b4621 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6efb2b0 View commit details
    Browse the repository at this point in the history