Skip to content
Snippets Groups Projects
  1. Oct 18, 2021
  2. Oct 15, 2021
  3. Oct 14, 2021
  4. Oct 13, 2021
    • Eric Eastwood's avatar
      Resolve and share `state_groups` for all historical events in batch (MSC2716) (#10975) · 35d6b914
      Eric Eastwood authored
      Resolve and share `state_groups` for all historical events in batch.  This also helps for showing the appropriate avatar/displayname in Element and will work whenever `/messages` has one of the historical messages as the first message in the batch.
      
      This does have the flaw where if you just insert a single historical event somewhere, it probably won't resolve the state correctly from `/messages` or `/context` since it will grab a non historical event above or below with resolved state which never included the historical state back then. For the same reasions, this also does not work in Element between the transition from actual messages to historical messages. In the Gitter case, this isn't really a problem since all of the historical messages are in one big lump at the beginning of the room.
      
      For a future iteration, might be good to look at `/messages` and `/context` to additionally add the `state` for any historical messages in that batch.
      
      ---
      
      How are the `state_groups` shared? To illustrate the `state_group` sharing, see this example:
      
      
      **Before** (new `state_group` for every event :grimacing:, very inefficient):
      ```
      # Tests from https://github.com/matrix-org/complement/pull/206
      $ COMPLEMENT_ALWAYS_PRINT_SERVER_LOGS=1 COMPLEMENT_DIR=../complement ./scripts-dev/complement.sh TestBackfillingHistory/parallel/should_resolve_member_state_events_for_historical_events
      create_new_client_event m.room.member event=$_JXfwUDIWS6xKGG4SmZXjSFrizhARM7QblhATVWWUcA state_group=None
      create_new_client_event org.matrix.msc2716.insertion event=$1ZBfmBKEjg94d-vGYymKrVYeghwBOuGJ3wubU1-I9y0 state_group=9
      create_new_client_event org.matrix.msc2716.insertion event=$Mq2JvRetTyclPuozRI682SAjYp3GqRuPc8_cH5-ezPY state_group=10
      create_new_client_event m.room.message event=$MfmY4rBQkxrIp8jVwVMTJ4PKnxSigpG9E2cn7S0AtTo state_group=11
      create_new_client_event m.room.message event=$uYOv6V8wiF7xHwOMt-60d1AoOIbqLgrDLz6ZIQDdWUI state_group=12
      create_new_client_event m.room.message event=$PAbkJRMxb0bX4A6av463faiAhxkE3FEObM1xB4D0UG4 state_group=13
      create_new_client_event org.matrix.msc2716.batch event=$Oy_S7AWN7rJQe_MYwGPEy6RtbYklrI-tAhmfiLrCaKI state_group=14
      ```
      
      **After** (all events in batch sharing `state_group=10`) (the base insertion event has `state_group=8` which matches the `prev_event` we're inserting next to):
      
      ```
      # Tests from https://github.com/matrix-org/complement/pull/206
      $ COMPLEMENT_ALWAYS_PRINT_SERVER_LOGS=1 COMPLEMENT_DIR=../complement ./scripts-dev/complement.sh TestBackfillingHistory/parallel/should_resolve_member_state_events_for_historical_events
      create_new_client_event m.room.member event=$PWomJ8PwENYEYuVNoG30gqtybuQQSZ55eldBUSs0i0U state_group=None
      create_new_client_event org.matrix.msc2716.insertion event=$e_mCU7Eah9ABF6nQU7lu4E1RxIWccNF05AKaTT5m3lw state_group=9
      create_new_client_event org.matrix.msc2716.insertion event=$ui7A3_GdXIcJq0C8GpyrF8X7B3DTjMd_WGCjogax7xU state_group=10
      create_new_client_event m.room.message event=$EnTIM5rEGVezQJiYl62uFBl6kJ7B-sMxWqe2D_4FX1I state_group=10
      create_new_client_event m.room.message event=$LGx5jGONnBPuNhAuZqHeEoXChd9ryVkuTZatGisOPjk state_group=10
      create_new_client_event m.room.message event=$wW0zwoN50lbLu1KoKbybVMxLbKUj7GV_olozIc5i3M0 state_group=10
      create_new_client_event org.matrix.msc2716.batch event=$5ZB6dtzqFBCEuMRgpkU201Qhx3WtXZGTz_YgldL6JrQ state_group=10
      ```
      35d6b914
    • David Robertson's avatar
      Fix upgrade dead links (#11069) · 40444426
      David Robertson authored
      40444426
    • David Robertson's avatar
      Rearrange the user_directory's `_handle_deltas` function (#11035) · 317e9e41
      David Robertson authored
      * Pull out `_handle_room_membership_event`
      * Discard excluded users early
      * Rearrange logic so the change is membership is effectively switched over. See PR for rationale.
      317e9e41
    • Sean Quah's avatar
      b59f3281
    • David Robertson's avatar
    • Patrick Cloke's avatar
      Add type hints to synapse.events.*. (#11066) · 1f9d0b8a
      Patrick Cloke authored
      Except `synapse/events/__init__.py`, which will be done in a follow-up.
      1f9d0b8a
    • Azrenbeth's avatar
    • Patrick Cloke's avatar
    • David Robertson's avatar
      Stop user directory from failing if it encounters users not in the `users` table. (#11053) · b83e8225
      David Robertson authored
      
      The following scenarios would halt the user directory updater:
      
      - user joins room
      - user leaves room
      - user present in room which switches from private to public, or vice versa.
      
      for two classes of users:
      
      - appservice senders
      - users missing from the user table.
      
      If this happened, the user directory would be stuck, unable to make forward progress.
      
      Exclude both cases from the user directory, so that we ignore them.
      
      Co-authored-by: default avatarEric Eastwood <erice@element.io>
      Co-authored-by: default avatarreivilibre <oliverw@matrix.org>
      Co-authored-by: default avatarSean Quah <8349537+squahtx@users.noreply.github.com>
      Co-authored-by: default avatarBrendan Abolivier <babolivier@matrix.org>
      b83e8225
    • reivilibre's avatar
      Mark Module API error imports as re-exported and mark Synapse as containing... · 2a2b1891
      reivilibre authored
      Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054)
      
      2a2b1891
  5. Oct 12, 2021
Loading