Refactor merge bundle space - #17
Open
liviaUeno wants to merge 19 commits into
Open
Conversation
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.
Merge bundles into spaces (paid spaces)
Summary
Makes spaces able to grant access to the rooms inside them, so a paid space replaces the former bundle concept: buying (or entering) a space joins the user to every room it contains. This is the backend half of retiring bundles in favour of a single "space" concept.
Previously a space was purely organisational and never granted access to its child rooms (Matrix keeps space membership and child-room access independent). This PR bridges that gap.
What's new
invite_space— enter a space and join all its roomsNew endpoint
POST /_synapse/room_service/invite_space(body:space_id). It reads the space's child rooms from them.space.childstate events and joins the requesting user to each of them via the admin API, then joins the user to the space itself. Returns the list of rooms the user was joined to.m.space.childevent with empty content) is ignored.space_children— list the rooms inside a spaceNew endpoint
POST /_synapse/room_service/space_children(body:space_id). Returns every child room with its name and member count. It runs with the admin, so it returns all children — including private rooms the requesting user is not yet a member of. This powers the "what's included" view before a user enters or buys a space. Requires an authenticated user (not admin-only).Spaces can be paid
No schema change was needed: a space already lives in the same
room_businesstable as a room and goes through the same create/visibility/price rules. A paid space is simplyaccess_type = "private"withprice > 0, exactly like a paid room; a free space isaccess_type = "public"withprice = 0.Endpoints added
POST /_synapse/room_service/invite_spacePOST /_synapse/room_service/space_childrenTests
invite_space(resource + service): success, missingspace_id, empty/not-found space, joining all children, skipping removed children, and continuing past a failed join.Notes
bundle_servicemodule is removed/disabled separately; this PR provides the space-side replacement for what bundles did (packaging rooms and granting access on purchase).