Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy load room members - Part I #667

Merged
merged 47 commits into from
Jul 26, 2018

Commits on Jul 10, 2018

  1. Configuration menu
    Copy the full SHA
    32651da View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a825ea0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8182777 View commit details
    Browse the repository at this point in the history
  4. emit individual events for lazily loaded members

    emit individual RoomState.members/newMember events
    for each lazily loaded member as batch events are not a thing.
    This makes updating the memberlist work
    bwindels committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    24a2aaa View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2018

  1. Configuration menu
    Copy the full SHA
    104ce78 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0e49ff2 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2018

  1. Configuration menu
    Copy the full SHA
    4224630 View commit details
    Browse the repository at this point in the history
  2. use more consistent naming

    bwindels committed Jul 13, 2018
    Configuration menu
    Copy the full SHA
    3614173 View commit details
    Browse the repository at this point in the history
  3. make method to get mxc avatar url public

    so MemberInfo can use it and take lazy loading into account
    bwindels committed Jul 13, 2018
    Configuration menu
    Copy the full SHA
    202c131 View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2018

  1. set lazily loaded members on all RoomStates of a room

    for all timelines in all timeline sets
    bwindels committed Jul 16, 2018
    Configuration menu
    Copy the full SHA
    6165dfd View commit details
    Browse the repository at this point in the history
  2. make sentinels lazy loading compatible

    dont just rely on member events, but just copy the member
    bwindels committed Jul 16, 2018
    Configuration menu
    Copy the full SHA
    6d017b1 View commit details
    Browse the repository at this point in the history
  3. fix whitespace

    bwindels committed Jul 16, 2018
    Configuration menu
    Copy the full SHA
    e2c6eea View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2018

  1. return sentinels with userid if members haven't been loaded yet,

    better than braking timeline continuation
    bwindels committed Jul 17, 2018
    Configuration menu
    Copy the full SHA
    0d55d4b View commit details
    Browse the repository at this point in the history
  2. make resetting the live timeline work with lazily loaded members

    In order for the lazy loading logic not to bleed into all corners
    of the JS SDK, I moved some of the state copying between timelines
    over to the RoomState and EventTimeLine class.
    bwindels committed Jul 17, 2018
    Configuration menu
    Copy the full SHA
    53e1203 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2018

  1. fix lint errors

    bwindels committed Jul 18, 2018
    Configuration menu
    Copy the full SHA
    eef07d5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ac07212 View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2018

  1. Configuration menu
    Copy the full SHA
    6ae2871 View commit details
    Browse the repository at this point in the history
  2. improve return type comment

    bwindels committed Jul 19, 2018
    Configuration menu
    Copy the full SHA
    a5ae548 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a1776ef View commit details
    Browse the repository at this point in the history
  4. Fix tests

    getSentinelMember now does return a member (with just the userid) when there is no corresponding member yet.
    With lazy loading it's perfectly possible the member is not available, and null breaks continuation in the timeline.
    bwindels committed Jul 19, 2018
    Configuration menu
    Copy the full SHA
    604a40e View commit details
    Browse the repository at this point in the history
  5. fix lint

    bwindels committed Jul 19, 2018
    Configuration menu
    Copy the full SHA
    0fd0653 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1bf9525 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    ab99fa0 View commit details
    Browse the repository at this point in the history
  8. move the fact that we're prototyping only with joined members up the …

    …stack to client
    
    only MatrixClient really needs to know that for now we only load joined members, the rest of the code can be generic for other membership types as that is the eventual plan, to also support invites at least.
    bwindels committed Jul 19, 2018
    Configuration menu
    Copy the full SHA
    578984d View commit details
    Browse the repository at this point in the history
  9. more consistent naming

    bwindels committed Jul 19, 2018
    Configuration menu
    Copy the full SHA
    411f05e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    8777c2e View commit details
    Browse the repository at this point in the history
  11. Lazy loaded members should never take precendence over members acquir…

    …ed through state events
    bwindels committed Jul 19, 2018
    Configuration menu
    Copy the full SHA
    cc80eef View commit details
    Browse the repository at this point in the history
  12. make sure LL member doesn't override state event

    extra safety check, as this should already not happen because of the check in RoomState
    bwindels committed Jul 19, 2018
    Configuration menu
    Copy the full SHA
    9d2b4ed View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    bd52b72 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2018

  1. 2, not 3 times

    bwindels committed Jul 20, 2018
    Configuration menu
    Copy the full SHA
    d27bc64 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c59b146 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f5613e5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cc75b2b View commit details
    Browse the repository at this point in the history
  5. only set the lazy members on the forward looking state of the live ti…

    …meline
    
    since back-paginating will also support lazy loading the state needed to display that part of the timeline, and no user interaction
    is supposed to happen before the lazy loaded member are, well, loaded, applying the ll members to all timelines should not be neccessary.
    bwindels committed Jul 20, 2018
    Configuration menu
    Copy the full SHA
    fc7bc8a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    92cb16d View commit details
    Browse the repository at this point in the history
  7. make sure LL members don't needlessly get disambiguated during a clone

    when cloning the state, lazy loaded members are copied over with their rawDisplayName,
    which could originate from their userId if they don't have a displayname.
    the displayname algorithm would assume that the displayname is explicitly set,
    and see if we'd have to disambiguate. As a fix, if the display name is the same as the id, just return the id
    bwindels committed Jul 20, 2018
    Configuration menu
    Copy the full SHA
    4db3c65 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d3b5e6d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8b3ded6 View commit details
    Browse the repository at this point in the history
  10. fix lint

    bwindels committed Jul 20, 2018
    Configuration menu
    Copy the full SHA
    1001f0f View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2018

  1. Use /members api for lazy loading

    This commit is a substantial change, as /members returns state events,
    not profile information as /joined_members, and this allows to simplify
    the implementation quite a bit. We can assume again all members have
    a state event associated with it.
    
    I also changed most of the naming of lazy loaded members to
    out-of-band members to reflect that this is the relevant bit for most
    of the code, that the members didn't come through /sync but through
    another channel.
    
    This commit also addresses the race condition between /(joined_)members
    and /sync. /members returns the members at the point in the timeline
    at a given event id. Members are loaded at the last event
    in the live timeline, and all members that come in from sync
    in the mean time are marked as superseding the out of band members,
    so they won't be overwritten, even if the timeline is reset in the
    mean time.
    
    Members are also marked if they originate from an out-of-band channel
    (/members) so they can be stored accordingly (future PR).
    
    The loading status is kept in room state now, as this made resolving
    the race condition easier. One consequence is that the status needs
    to be shared across cloned instances of RoomState. When resetting
    the timeline (and cloning the room state) while lazy loading is in
    progress, one of the RoomStates could be left in progress indefinitely.
    Though that is more for clarity than avoiding any actual bugs.
    bwindels committed Jul 24, 2018
    Configuration menu
    Copy the full SHA
    a84dc8d View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2018

  1. fix lint & fix and add tests

    bwindels committed Jul 25, 2018
    Configuration menu
    Copy the full SHA
    ae6cf68 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    89e8801 View commit details
    Browse the repository at this point in the history
  3. remove obsolete flag

    bwindels committed Jul 25, 2018
    Configuration menu
    Copy the full SHA
    7223149 View commit details
    Browse the repository at this point in the history
  4. store membership from during sync, because we might not have own memb…

    …ership
    
    to determine where a room should show up in the room list, we need to know
    our membership type. But with lazy loading, we might not have our own member
    if we weren't recently active in the room. Using getSyncedMembership can be
    used to fallback if the users membership is not yet available.
    bwindels committed Jul 25, 2018
    Configuration menu
    Copy the full SHA
    c196ca0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e478421 View commit details
    Browse the repository at this point in the history
  6. fix lint

    bwindels committed Jul 25, 2018
    Configuration menu
    Copy the full SHA
    2e8198e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    66ec268 View commit details
    Browse the repository at this point in the history