Skip to content
Snippets Groups Projects
  1. Oct 20, 2021
  2. Oct 18, 2021
  3. Oct 15, 2021
  4. Oct 14, 2021
    • Eric Eastwood's avatar
      Fix 500 error on `/messages` when we accumulate more than 5 backward extremities (#11027) · daf498e0
      Eric Eastwood authored
      Found while working on the Gitter backfill script and noticed
      it only happened after we sent 7 batches, https://gitlab.com/gitterHQ/webapp/-/merge_requests/2229#note_665906390
      
      When there are more than 5 backward extremities for a given depth,
      backfill will throw an error because we sliced the extremity list
      to 5 but then try to iterate over the full list. This causes
      us to look for state that we never fetched and we get a `KeyError`.
      
      Before when calling `/messages` when there are more than 5 backward extremities:
      ```
      Traceback (most recent call last):
        File "/usr/local/lib/python3.8/site-packages/synapse/http/server.py", line 258, in _async_render_wrapper
          callback_return = await self._async_render(request)
        File "/usr/local/lib/python3.8/site-packages/synapse/http/server.py", line 446, in _async_render
          callback_return = await raw_callback_return
        File "/usr/local/lib/python3.8/site-packages/synapse/rest/client/room.py", line 580, in on_GET
          msgs = await self.pagination_handler.get_messages(
        File "/usr/local/lib/python3.8/site-packages/synapse/handlers/pagination.py", line 396, in get_messages
          await self.hs.get_federation_handler().maybe_backfill(
        File "/usr/local/lib/python3.8/site-packages/synapse/handlers/federation.py", line 133, in maybe_backfill
          return await self._maybe_backfill_inner(room_id, current_depth, limit)
        File "/usr/local/lib/python3.8/site-packages/synapse/handlers/federation.py", line 386, in _maybe_backfill_inner
          likely_extremeties_domains = get_domains_from_state(states[e_id])
      KeyError: '$zpFflMEBtZdgcMQWTakaVItTLMjLFdKcRWUPHbbSZJl'
      ```
      daf498e0
    • Patrick Cloke's avatar
      Ensure each charset is attempted only once during media preview. (#11089) · efd0074a
      Patrick Cloke authored
      There's no point in trying more than once since it is guaranteed to
      continually fail.
      efd0074a
    • Patrick Cloke's avatar
      Attempt different character encodings when previewing a URL. (#11077) · e2f0b49b
      Patrick Cloke authored
      This follows similar logic to BeautifulSoup where we attempt different
      character encodings until we find one which works.
      e2f0b49b
    • Patrick Cloke's avatar
    • reivilibre's avatar
      Add a test for a workaround concerning the behaviour of third-party rule... · 50d86015
      reivilibre authored
      Add a test for a workaround concerning the behaviour of third-party rule modules and `SynapseError`s. (#11071)
      
      50d86015
  5. Oct 13, 2021
  6. Oct 12, 2021
  7. Oct 08, 2021
  8. Oct 07, 2021
  9. Oct 06, 2021
  10. Oct 05, 2021
    • David Robertson's avatar
      Fix potential leak of per-room profiles when the user dir is rebuilt. (#10981) · 4f00432c
      David Robertson authored
      
      There are two steps to rebuilding the user directory:
      
      1. a scan over rooms, followed by
      2. a scan over local users.
      
      The former reads avatars and display names from the `room_memberships`
      table and therefore contains potentially private avatars and
      display names. The latter reads from the the `profiles` table which only
      contains public data; moreover it will overwrite any private profiles
      that the rooms scan may have written to the user directory. This means
      that the rebuild could leak private user while the rebuild was in
      progress, only to later cover up the leaks once the rebuild had completed.
      
      This change skips over local users when writing user_directory rows
      when scanning rooms. Doing so means that it'll take longer for a rebuild
      to make local users searchable, which is unfortunate. I think a future
      PR can improve this by swapping the order of the two steps above. (And
      indeed there's more to do here, e.g. copying from `profiles` without
      going via Python.)
      
      Small tidy-ups while I'm here:
      
      * Remove duplicated code from test_initial. This was meant to be pulled into `purge_and_rebuild_user_dir`.
      * Move `is_public` before updating sharing tables. No functional change; it's still before the first read of `is_public`.
      * Don't bother creating a set from dict keys. Slightly nicer and makes the code simpler.
      
      Co-authored-by: default avatarRichard van der Hoff <1389908+richvdh@users.noreply.github.com>
      4f00432c
  11. Oct 04, 2021
  12. Oct 01, 2021
  13. Sep 30, 2021
Loading