-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test for non-member state events in /batch_send
state_events_at_start
#354
Add test for non-member state events in /batch_send
state_events_at_start
#354
Conversation
// historical batch | ||
"limit": []string{fmt.Sprintf("%d", len(expectedEventIDOrder))}, | ||
// We add these options to the filter so we get member events in the state field | ||
"filter": []string{"{\"lazy_load_members\":true,\"include_redundant_members\":true}"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/messages
was only returning member state events and only because we passed this special filter. Now that we're testing with non-member state events, we need an endpoint which will show us them.
We can instead simplify and just use /context
directly 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bear in mind that /context
does not work over federation. That is, if server A is in room X and sends 100 messages, then server B joins room X and hits /context
for an event early in the timeline (so not backfilled) it will 404.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the validateState
block (which calls /context
) after we call /messages
which will backfill any of the potential gaps 👍
Part of #12110 Complement test: matrix-org/complement#354 Previously, they didn't resolve because async `filter_events_for_client` removes all outlier state except for out-of-band membership.
tests/msc2716_test.go
Outdated
eventIdBefore := eventIDsBefore[0] | ||
timeAfterEventBefore := time.Now() | ||
|
||
state_events_at_start := createJoinStateEventsForBatchSendRequest([]string{virtualUserID}, timeAfterEventBefore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
camelCase
please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a linter/autoformatter to use to avoid these kinds of mistakes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is, but I don't think it's built into CI. Added it to #290
// historical batch | ||
"limit": []string{fmt.Sprintf("%d", len(expectedEventIDOrder))}, | ||
// We add these options to the filter so we get member events in the state field | ||
"filter": []string{"{\"lazy_load_members\":true,\"include_redundant_members\":true}"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bear in mind that /context
does not work over federation. That is, if server A is in room X and sends 100 messages, then server B joins room X and hits /context
for an event early in the timeline (so not backfilled) it will 404.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge whenever you want!
…nts (MSC2716) (#12329) Part of #12110 Complement test: matrix-org/complement#354 Previously, they didn't resolve because async `filter_events_for_client` removes all outlier state except for out-of-band membership. And fundamentally, we have the state at these events so they shouldn't be marked as outliers.
Thanks for the review @kegsay 🐬 Was waiting for matrix-org/synapse#12329 to merge 🚢 |
Add test for non-member state events in
/batch_send
state_events_at_start
Tests for matrix-org/synapse#12110
Synapse changes: matrix-org/synapse#12329