mx_room_create(): pass creation_content through - #17
Merged
Conversation
A space is an ordinary room with `type: "m.space"` in its m.room.create event. That field is fixed at creation and immutable afterwards, so there is no set-it-later path -- without a way to send creation_content, mx.api cannot make one at all. The new test captures the request body by stubbing mx_http, which is the only way to see the shape of this field without a server. It asserts the JSON, not the R value: mx_http auto-unboxes, so an unnamed list(...) of one string serializes to a bare "m.space" and the server answers with a perfectly ordinary room. The failure is a space-less space rather than an error, which is why an unnamed list is refused at the call instead. The man/ churn in mx_keys_upload, mx_read_receipt, mx_register and mx_send_media is tinyrox regenerating drift; no roxygen source changed for those.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A space is an ordinary room with
type: "m.space"in itsm.room.createevent. That field is fixed at creation and immutable afterwards, so there is no set-it-later path — without a way to sendcreation_content, mx.api cannot make one at all.The test asserts the JSON, not the R value
mx_httpserializes withauto_unbox = TRUE. An unnamedlist("m.space")therefore goes out as a bare string rather than an object, and the server answers that with a perfectly ordinary room. The failure is a space-less space, not an error — so an unnamed list is refused at the call instead, and the passing case is pinned on the serialized form:mx_httpis stubbed and the request body captured, which is the only way to see the shape of this field without a server. The existingtest_rooms.Rchecks that the function exists; this checks what it sends.Verified
193 tests, all green.
Live: created the
devspace now holding 45 rooms across two bot accounts.The
man/churn inmx_keys_upload,mx_read_receipt,mx_registerandmx_send_mediais tinyrox regenerating drift — no roxygen source changed for those.