Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Remove the experimental spaces enabled flag. (#10063)
Browse files Browse the repository at this point in the history
In lieu of just always enabling the unstable spaces endpoint and
unstable room version.
  • Loading branch information
clokep committed May 26, 2021
1 parent 49df2c2 commit f42e4c4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 49 deletions.
1 change: 1 addition & 0 deletions changelog.d/10063.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove the experimental `spaces_enabled` flag. The spaces features are always available now.
15 changes: 0 additions & 15 deletions docs/sample_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2916,18 +2916,3 @@ redis:
# Optional password if configured on the Redis instance
#
#password: <secret_password>


# Enable experimental features in Synapse.
#
# Experimental features might break or be removed without a deprecation
# period.
#
experimental_features:
# Support for Spaces (MSC1772), it enables the following:
#
# * The Spaces Summary API (MSC2946).
# * Restricting room membership based on space membership (MSC3083).
#
# Uncomment to disable support for Spaces.
#spaces_enabled: false
2 changes: 1 addition & 1 deletion synapse/api/room_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,6 @@ class RoomVersions:
RoomVersions.V5,
RoomVersions.V6,
RoomVersions.MSC2176,
RoomVersions.MSC3083,
)
# Note that we do not include MSC3083 here unless it is enabled in the config.
} # type: Dict[str, RoomVersion]
23 changes: 0 additions & 23 deletions synapse/config/experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from synapse.api.room_versions import KNOWN_ROOM_VERSIONS, RoomVersions
from synapse.config._base import Config
from synapse.types import JsonDict

Expand All @@ -28,27 +27,5 @@ def read_config(self, config: JsonDict, **kwargs):
# MSC2858 (multiple SSO identity providers)
self.msc2858_enabled = experimental.get("msc2858_enabled", False) # type: bool

# Spaces (MSC1772, MSC2946, MSC3083, etc)
self.spaces_enabled = experimental.get("spaces_enabled", True) # type: bool
if self.spaces_enabled:
KNOWN_ROOM_VERSIONS[RoomVersions.MSC3083.identifier] = RoomVersions.MSC3083

# MSC3026 (busy presence state)
self.msc3026_enabled = experimental.get("msc3026_enabled", False) # type: bool

def generate_config_section(self, **kwargs):
return """\
# Enable experimental features in Synapse.
#
# Experimental features might break or be removed without a deprecation
# period.
#
experimental_features:
# Support for Spaces (MSC1772), it enables the following:
#
# * The Spaces Summary API (MSC2946).
# * Restricting room membership based on space membership (MSC3083).
#
# Uncomment to disable support for Spaces.
#spaces_enabled: false
"""
13 changes: 6 additions & 7 deletions synapse/federation/transport/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1562,13 +1562,12 @@ def register_servlets(
server_name=hs.hostname,
).register(resource)

if hs.config.experimental.spaces_enabled:
FederationSpaceSummaryServlet(
handler=hs.get_space_summary_handler(),
authenticator=authenticator,
ratelimiter=ratelimiter,
server_name=hs.hostname,
).register(resource)
FederationSpaceSummaryServlet(
handler=hs.get_space_summary_handler(),
authenticator=authenticator,
ratelimiter=ratelimiter,
server_name=hs.hostname,
).register(resource)

if "openid" in servlet_groups:
for servletclass in OPENID_SERVLET_CLASSES:
Expand Down
4 changes: 1 addition & 3 deletions synapse/rest/client/v1/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,9 +1060,7 @@ def register_servlets(hs: "HomeServer", http_server, is_worker=False):
RoomRedactEventRestServlet(hs).register(http_server)
RoomTypingRestServlet(hs).register(http_server)
RoomEventContextServlet(hs).register(http_server)

if hs.config.experimental.spaces_enabled:
RoomSpaceSummaryRestServlet(hs).register(http_server)
RoomSpaceSummaryRestServlet(hs).register(http_server)

# Some servlets only get registered for the main process.
if not is_worker:
Expand Down

0 comments on commit f42e4c4

Please sign in to comment.