From c9951194fec8712931c83449e5227a5011faae40 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Mon, 17 Mar 2025 07:38:36 +0200 Subject: [PATCH] Fix merging of `_auto` and `_custom` into `matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci` so that a list is produced `group_vars/matrix_servers` was correctly populating `matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci_auto` with a list, but: - the defaults for these variables were hinting that hashmaps are necessary - merging of `_auto` and `_custom` was done as if for hashmaps, not lists As a result, `/.well-known/matrix/client` looked like this: ```json { "org.matrix.msc4143.rtc_foci": { "livekit_service_url": "https://matrix.example.com/livekit-jwt-service", "type": "livekit" } } ``` .. instead of what's expected as per MSC4143 (https://github.com/matrix-org/matrix-spec-proposals/pull/4143): ```json { "org.matrix.msc4143.rtc_foci": [ { "livekit_service_url": "https://matrix.example.com/livekit-jwt-service", "type": "livekit" } ] } ``` Regardless of our incorrectly formatted `org.matrix.msc4143.rtc_foci` configuration in `/.well-known/matrix/client`, Element Web still seemed to be able to discover LiveKit JWT Service (and by extension, LiveKit Server) correctly, even without this fix. --- roles/custom/matrix-static-files/defaults/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/custom/matrix-static-files/defaults/main.yml b/roles/custom/matrix-static-files/defaults/main.yml index 77340c7b9..53c461dcc 100644 --- a/roles/custom/matrix-static-files/defaults/main.yml +++ b/roles/custom/matrix-static-files/defaults/main.yml @@ -218,9 +218,9 @@ matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci_enab # Controls the org.matrix.msc4143.rtc_foci property in the /.well-known/matrix/client file. # See `matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci_enabled` -matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci: "{{ matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci_auto | combine(matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci_custom, recursive=True) }}" -matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci_auto: {} -matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci_custom: {} +matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci: "{{ matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci_auto+ matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci_custom }}" +matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci_auto: [] +matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci_custom: [] # Default /.well-known/matrix/client configuration template which covers the generic use case. # You can customize it by controlling the various variables inside it.