Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Apr 24, 2018

Fixes #195

Although the actual fix ended up being only 2 simple extra lines, there's quite some pre-work.

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.

Tests were fixed blindly. LMK if they broke.

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'.

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

ghost commented Apr 24, 2018

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

@ghost
Copy link
Author

ghost commented Apr 24, 2018

Right, so the test broke because it was validating the wrong behaviour, which is fixed with this PR.

FYI, the example sync response is not representative, because the timeline contains a join event referring to a previous invite state, but that state does not appear in 'state'. Not fixing that, though.

@ghost ghost closed this Apr 24, 2018
@ghost
Copy link
Author

ghost commented Apr 24, 2018

Closed in favour of #199

@ghost ghost deleted the fix_195 branch April 24, 2018 13:38
This pull request was closed.
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»

0 participants