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

Refactor MSC3030 /timestamp_to_event to move away from our snowflake pull from destination pattern #14096

Commits on Oct 7, 2022

  1. Configuration menu
    Copy the full SHA
    8867831 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f03a2b6 View commit details
    Browse the repository at this point in the history
  3. Fix Complement MSC3030 `can_paginate_after_getting_remote_event_from_…

    …timestamp_to_event_endpoint` test flake. Make sure we backfill the closest local event if it's an `outlier` so we can use it with `/context` and paginate `/messages` from this point. Previously we only did this for a remote event.
    
    Fix  #13944
    
    Why did this fail before? Why was it flakey?
    ====================================================
    
    Sleuthing the server logs on the CI failure, it looks like `hs2:/timestamp_to_event` found `$NP6-oU7mIFVyhtKfGvfrEQX949hQX-T-gvuauG6eurU` as an `outlier` event locally. Then when we went and asked for it via `/context`, since it's an `outlier`, it was filtered out of the results -> `You don't have permission to access that event.`
    
    This is reproducible when `sync_partial_state` races and persists `$NP6-oU7mIFVyhtKfGvfrEQX949hQX-T-gvuauG6eurU` as an `outlier` before we evaluate `get_event_for_timestamp(...)`. To consistently reproduce locally, just add a delay at the [start of `get_event_for_timestamp(...)`](https://github.com/matrix-org/synapse/blob/cb20b885cb4bd1648581dd043a184d86fc8c7a00/synapse/handlers/room.py#L1470-L1496) so it always runs after `sync_partial_state` completes.
    
    ```py
    from twisted.internet import task as twisted_task
    d = twisted_task.deferLater(self.hs.get_reactor(), 3.5)
    await d
    ```
    
    In a run where it passes, on `hs2`, `get_event_for_timestamp(...)` finds a different event locally which is next to a gap and we request from a closer one from `hs1` which gets backfilled. And since the backfilled event is not an `outlier`, it's returned as expected during `/context`.
    
    Future changes
    ==========================
    
    In a future PR, it would be nice if `/context` would just backfill the event for us. This would also help with #3848
    MadLittleMods committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    7c82755 View commit details
    Browse the repository at this point in the history
  4. Remove scratch changes

    MadLittleMods committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    3ce3984 View commit details
    Browse the repository at this point in the history
  5. Add changelog

    MadLittleMods committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    720788d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    da87def View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2022

  1. Configuration menu
    Copy the full SHA
    7332df1 View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2022

  1. Merge branch 'develop' into madlittlemods/13944-fix-msc3030-jump-to-d…

    …ate-complement-backfill-test-flake
    MadLittleMods committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    482629b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a57fceb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7f86fef View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2022

  1. Merge branch 'develop' into madlittlemods/13944-fix-msc3030-jump-to-d…

    …ate-complement-backfill-test-flake
    MadLittleMods committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    79f2fea View commit details
    Browse the repository at this point in the history
  2. Avoid f-string with logger to prevent unnecessary string interpolatio…

    …n when not logging at that severity
    
    See #14096 (comment)
    MadLittleMods committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    25ce11c View commit details
    Browse the repository at this point in the history
  3. Use else

    Co-authored-by: Erik Johnston <[email protected]>
    MadLittleMods and erikjohnston authored Oct 25, 2022
    Configuration menu
    Copy the full SHA
    64a907a View commit details
    Browse the repository at this point in the history