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

make /context lazyload & filter aware #3567

Merged
merged 20 commits into from
Jul 27, 2018
Merged

make /context lazyload & filter aware #3567

merged 20 commits into from
Jul 27, 2018

Conversation

ara4n
Copy link
Member

@ara4n ara4n commented Jul 20, 2018

ara4n added 7 commits June 4, 2018 01:04
as per the proposal; we can deduplicate redundant lazy-loaded members
which are sent in the same sync sequence. we do this heuristically
rather than requiring the client to somehow tell us which members it
has chosen to cache, by instead caching the last N members sent to
a client, and not sending them again.  For now we hardcode N to 100.
Each cache for a given (user,device) tuple is in turn cached for up to
X minutes (to avoid the caches building up).  For now we hardcode X to 30.
@matrixbot
Copy link
Member

Build finished.

@ara4n ara4n mentioned this pull request Jul 23, 2018
@ara4n ara4n changed the base branch from matthew/remove_redundant_lazy_members to develop July 26, 2018 21:53
types = [(EventTypes.Member, member) for member in members.keys()]

# XXX: why do we return the state as of the last event rather than the
# first? Shouldn't we be consistent with /sync?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(it would be helpful to link to the bug in the comment, I guess)

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm modulo confusion over comment

@@ -531,11 +531,20 @@ def on_GET(self, request, room_id, event_id):

limit = parse_integer(request, "limit", default=10)

# for symmetry with /messages for now
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand this comment. What do you mean, for now?

@richvdh richvdh assigned ara4n and unassigned richvdh Jul 27, 2018
types = None
filtered_types = None
if event_filter and event_filter.lazy_load_members():
members = {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hrm, can we use a set rather than a dict here?

members = set()
# ...
members.add(ev.sender)

or even:

members = set(ev.sender for ev in itertools.chain(
        results["events_before"],
        (results["event"],),
        results["events_after"],
))

@ara4n
Copy link
Member Author

ara4n commented Jul 27, 2018

richvdh @ptal

@ara4n ara4n assigned richvdh and unassigned ara4n Jul 27, 2018
@ara4n
Copy link
Member Author

ara4n commented Jul 27, 2018

oh, i missed you lgtm'd it mod the changes. thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants