Skip to content

Handle state events in 'timeline'#199

Merged
non-Jedi merged 3 commits intomasterfrom
unknown repository
May 14, 2018
Merged

Handle state events in 'timeline'#199
non-Jedi merged 3 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Apr 24, 2018

Fixes #195 (2nd attempt)

Although the actual fix ended up being only 2 simple extra lines, there's some pre-work. Even the fix needed an extra line to repair the test which was actually asserting the wrong behaviour.

Had to refactor the Enum replacement so I could refer to its constants in the room module, and managed to make it simpler using only 5 SLOC.

Moved _process_state_event to the room class as well, which really benefited the next patch needing only 2 SLOC.

Suggest a non-squashing merge for this PR.

Matrixcoffee added 3 commits April 24, 2018 00:55
So we can have full instances of our enum class instead of bare ints.
State events can and should arrive via the timeline. The contents of 'state' in
the sync response are actually the state at the beginning of 'timeline'.

Fixed the test which was validating the wrong behavour (ignoring timeline).

Spec: https://matrix.org/docs/spec/client_server/r0.3.0.html#syncing

Fixes: #195 State events can arrive both through "state" and "timeline"
@ghost ghost mentioned this pull request Apr 24, 2018
@ghost
Copy link
Author

ghost commented Apr 24, 2018

Signed-off-by: Маrtіn vаո Βeіlеn (@Coffee:matrix.org)

@non-Jedi
Copy link
Collaborator

LGTM. Thanks!

@non-Jedi non-Jedi merged commit 8e156c0 into matrix-org:master May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

State events can arrive both through «state» and «timeline»

1 participant