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

Fix providing a RoomStreamToken instance to _notify_app_services_ephemeral #11137

Merged
merged 9 commits into from
Nov 2, 2021

Commits on Oct 20, 2021

  1. Fix providing a RoomStreamToken instance to _notify_app_services_ephe…

    …meral
    
    Previously, if a RoomStreamToken object were provided, new_token would
    be set to `None`. In the same changeset, which was intended to prevent
    mypy from failing, `_notify_app_services_ephemeral` was configured
    to allow `new_token` to be an Optional[int]
    (559974f).
    
    However, if `None` is provided, `_notify_app_services_ephemeral` will
    end up passing `None` to `set_type_stream_id_for_appservice`, which will
    effectively clear each appservice's stream token for the given
    `stream_key`. This seems like a bug to do every time we have a
    RoomStreamToken rather than an int.
    
    Instead, I'm converting the RoomStreamToken to an int using
    RoomStreamToken.stream. I think this is the right way to convert to an
    int. If RoomStreamToken this ends up being a vector clock, `stream` will
    be the minimum stream token amongst all workers... which I think is fine?
    anoadragon453 committed Oct 20, 2021
    Configuration menu
    Copy the full SHA
    4d6af01 View commit details
    Browse the repository at this point in the history
  2. Changelog

    anoadragon453 committed Oct 20, 2021
    Configuration menu
    Copy the full SHA
    b0d775a View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2021

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

Commits on Oct 26, 2021

  1. Add missing return type hints for stream ids

    While searching around for all types that were eventually passed into on_new_event,
    I found a couple methods which didn't specify the type they returned. So this commit
    adds return type hints for those methods.
    
    I didn't do any other arguments as I plan to type-hint those files later anyways.
    anoadragon453 committed Oct 26, 2021
    Configuration menu
    Copy the full SHA
    ebda0d1 View commit details
    Browse the repository at this point in the history
  2. Remove _notify_app_services_ephemeral; convert token in on_new_event …

    …instead
    
    This is a small effort to reduce the layers of methods we have here.
    
    Also, I've opted to continue converting the RoomStreamToken to an int,
    but only for when tracking stream tokens of EDUs. As stated in the
    comment, this shouldn't have any gaps as long as we *always* convert to
    minimum value.
    anoadragon453 committed Oct 26, 2021
    Configuration menu
    Copy the full SHA
    61f9a82 View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2021

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

Commits on Nov 1, 2021

  1. Configuration menu
    Copy the full SHA
    c9ede35 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4414e22 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2021

  1. Apply suggestions from code review

    Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
    anoadragon453 and richvdh committed Nov 2, 2021
    Configuration menu
    Copy the full SHA
    8411bdb View commit details
    Browse the repository at this point in the history