Update state idempotency tests to not use initialsync#960
Update state idempotency tests to not use initialsync#960neilalexander wants to merge 2 commits intodevelopfrom
Conversation
richvdh
left a comment
There was a problem hiding this comment.
I think this is a bit broken, as reflected in the fact the tests are failing.
| update_next_batch => 0, | ||
| set_presence => "offline", | ||
| )->then( sub { | ||
| my ( $body ) = @_; |
There was a problem hiding this comment.
I'm no fan of the 3-space indentation convention, but 5 spaces doesn't seem an improvement...
There was a problem hiding this comment.
VS Code yet again :/
|
|
||
| my $event_id = $state_by_type{ $type }[0]{event_id}; | ||
| log_if_fail "Event for ${\$user->user_id}", $event; | ||
| Future->done( $event->{event_id} ); |
There was a problem hiding this comment.
this creates a Future which is discarded?
There was a problem hiding this comment.
ah I think this should be at the higher level?
There was a problem hiding this comment.
Honestly I have no idea. I still don't think I grok how this works looking at it again.
|
|
||
| my %state_by_type = partition_by { $_->{type} } @{ $body->{state} }; | ||
| # We expect the event to be in the initial sync | ||
| sync_timeline_contains( $body, $room_id, sub { |
There was a problem hiding this comment.
I think sync_timeline_contains returns a truthy result? shouldn't we be doing something with that result (otherwise the call is redundant?)
There was a problem hiding this comment.
I just copy-pasta'd from elsewhere, but I figured that if the timeline didn't hit the sub and match the event we want, that the Future wouldn't be done?
| matrix_put_room_state( $user, $room_id, | ||
| type => "a.test.state.type", | ||
| state_key => "", | ||
| state_key => $user->user_id, |
There was a problem hiding this comment.
Mostly just to match the filter return unless $event->{type} eq $type and $event->{state_key} eq $user->user_id; in sync_timeline_contains.
|
@neilalexander is this still on your radar? |
This updates the following tests so that they no longer use initialsync:
Closes matrix-org/dendrite#1311.