-
Notifications
You must be signed in to change notification settings - Fork 69
feat: support for room v11 #858
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
Changes from all commits
1feb361
177f831
4699ff5
a567eb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -497,6 +497,16 @@ func TestOutboundFederationEventSizeGetMissingEvents(t *testing.T) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }).Methods("POST") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ver := alice.GetDefaultRoomVersion(t) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // This test crafts a "bad" event which state_key is 280 bytes but only 70 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // codepoints. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Room version 11 in Synapse switched from using codepoints to using | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // bytes. Which means the 280-byte state_key would be rejected immediately. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Use room version 10 in that case so the codepoint-based limit is in effect. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if gomatrixserverlib.MustGetRoomVersion(ver).StrictEventByteLimits() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ver = gomatrixserverlib.RoomVersion("10") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MadLittleMods marked this conversation as resolved.
Comment on lines
499
to
+509
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like this test would be better if we just always used room version 10 🤔 . The current setup is only better if we're trying to support homeservers that don't support room version 10 yet (do we care about that?)
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea I thought it's better to be flexible (since it's not a big change in the test code), but I can apply your suggestion if you think it's better
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably simplest to converge on room version 10. If there is a use case for the alternative, we can go that route but the comment should better explain the intention. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| charlie := srv.UserID("charlie") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| room := srv.MustMakeRoom(t, ver, federation.InitialRoomEvents(ver, charlie)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| roomAlias := srv.MakeAliasMapping("flibble", room.RoomID) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.