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

make /context lazyload & filter aware - #3567

Merged
ara4n merged 20 commits into
developfrom
matthew/lazy_load_apis
Jul 27, 2018
Merged

ara4n merged 20 commits into
developfrom
matthew/lazy_load_apis

Conversation

@ara4n

@ara4n ara4n commented Jul 20, 2018 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Comment thread synapse/handlers/room.py
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
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)

@richvdh richvdh left a comment

Copy link
Copy Markdown
Member

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

Comment thread synapse/rest/client/v1/room.py Outdated

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

# for symmetry with /messages for now

Copy link
Copy Markdown
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
Comment thread synapse/handlers/room.py Outdated
types = None
filtered_types = None
if event_filter and event_filter.lazy_load_members():
members = {}

Copy link
Copy Markdown
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

ara4n commented Jul 27, 2018

Copy link
Copy Markdown
Member Author

richvdh @ptal

@ara4n ara4n assigned richvdh and unassigned ara4n Jul 27, 2018
@ara4n

ara4n commented Jul 27, 2018

Copy link
Copy Markdown
Member Author

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