Conversation
| }) | ||
|
|
||
| // Bob receives the invite and joins. | ||
| next_batch := bob.SyncUntilInvitedTo(t, roomID) |
There was a problem hiding this comment.
Please use camelCase instead for variable names.
| } | ||
| bob.SyncUntilTimelineHas(t, roomID, isBobJoinEvent) | ||
|
|
||
| // Repeat the sync, but in a form where we can inspect the output. |
There was a problem hiding this comment.
This doesn't make sense because SyncUntilTimelineHas returns each event in the callback func(ev gjson.Result). You can do any inspection or assertion you like on the event, and indeed you already do on :30 to check the type/state_key/membership.
| events := eventRes.Array() | ||
| bobJoinEvents := 0 | ||
| for _, ev := range events { | ||
| if isBobJoinEvent(ev) { |
There was a problem hiding this comment.
This doesn't make sense, why are you asserting the same thing twice?
There was a problem hiding this comment.
This makes more sense now that I know you're testing for duplicate events.
| "github.com/tidwall/gjson" | ||
| ) | ||
|
|
||
| func TestDirectMessageCreate(t *testing.T) { |
There was a problem hiding this comment.
Not a good test name. I had to read matrix-org/synapse#9768 to figure out what the regression test here is for. Please at the very least mention duplicate membership event somewhere.
|
The test file needs to be formatted with In addition, it's not clear if this test case is race-free. We assume in the test currently that the duplicate event will appear immediately after the |
The required incantation was goimports -local github.com/matrix-org/complement -w internal testsWhich I suggest we write down in ONBOARDING.md. |
|
@DMRobertson please update this PR to use the new functional options for syncing as shown in #272 - you shouldn't need to modify |
|
@DMRobertson what is the status of this PR? |
It's on my wishlist of things to get to if I find time. I'm not planning to actively work on the linked Synapse issue any time soon, though; feel free to close this PR if it helps manage the repo. (I can always reopen.) |
|
Closing on the basis that you can re-open it later. This PR is just adding noise. |
No description provided.