From b01e6d58fde6e7598fb89d2957d41d5c6631de08 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 1 Jul 2026 10:40:41 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F(core)=20fix=20typo=20in=20se?= =?UTF-8?q?ttings=20COLLABORATION=5FWS=5FNOT=5FCONNECTED=5FREADY=5FONLY?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The settings COLLABORATION_WS_NOT_CONNECTED_READY_ONLY contains a typo. We don't want to see READY_ONLY but READ_ONLY. This commit fix the typo and change everywhere in the codebase the settings name. --- CHANGELOG.md | 1 + documentation/env.md | 2 +- env.d/development/common | 2 +- src/backend/core/api/viewsets.py | 8 ++--- .../documents/test_api_documents_can_edit.py | 18 +++++----- .../test_api_documents_content_update.py | 18 +++++----- .../documents/test_api_documents_update.py | 34 +++++++++---------- src/backend/core/tests/test_api_config.py | 4 +-- src/backend/impress/settings.py | 10 ++++-- .../app-impress/doc-collaboration.spec.ts | 2 +- .../e2e/__tests__/app-impress/utils-common.ts | 2 +- .../impress/src/core/config/api/useConfig.tsx | 2 +- .../hooks/useIsCollaborativeEditable.tsx | 2 +- src/helm/env.d/dev/values.impress.yaml.gotmpl | 2 +- .../env.d/feature/values.impress.yaml.gotmpl | 2 +- 15 files changed, 57 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95523d42d..300304455 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to - ♿️(frontend) align search modal field label with placeholder #2384 - 🚚(frontend) move Waffle to bottom left #2455 - ♿️(frontend) remove redundant aria-label on table of contents links #2459 +- ♻️(core) fix typo in settings COLLABORATION_WS_NOT_CONNECTED_READY_ONLY #2481 ### Fixed diff --git a/documentation/env.md b/documentation/env.md index 81a821e21..6da1e30e8 100644 --- a/documentation/env.md +++ b/documentation/env.md @@ -35,7 +35,7 @@ These are the environment variables you can set for the `impress-backend` contai | COLLABORATION_API_URL | Collaboration api host | | | COLLABORATION_SERVER_SECRET | Collaboration api secret | | | COLLABORATION_WS_INACTIVITY_TIMEOUT | Timeout (in seconds) after which the user is considered inactive when there is no activity. The WebSocket is closed after this inactivity period. `None` means disabled. | None | -| COLLABORATION_WS_NOT_CONNECTED_READY_ONLY | Users not connected to the collaboration server cannot edit | false | +| COLLABORATION_WS_NOT_CONNECTED_READ_ONLY | Users not connected to the collaboration server cannot edit | false | | COLLABORATION_WS_URL | Collaboration websocket url | | | CONVERSION_API_CONTENT_FIELD | Conversion api content field | content | | CONVERSION_API_ENDPOINT | Conversion API endpoint | convert | diff --git a/env.d/development/common b/env.d/development/common index e187e2c6c..b0aea4e69 100644 --- a/env.d/development/common +++ b/env.d/development/common @@ -76,7 +76,7 @@ COLLABORATION_API_URL=http://y-provider-development:4444/collaboration/api/ COLLABORATION_BACKEND_BASE_URL=http://app-dev:8000 COLLABORATION_SERVER_ORIGIN=http://localhost:3000 COLLABORATION_SERVER_SECRET=my-secret -COLLABORATION_WS_NOT_CONNECTED_READY_ONLY=true +COLLABORATION_WS_NOT_CONNECTED_READ_ONLY=true COLLABORATION_WS_URL=ws://localhost:4444/collaboration/ws/ COLLABORATION_WS_INACTIVITY_TIMEOUT=15 # Seconds diff --git a/src/backend/core/api/viewsets.py b/src/backend/core/api/viewsets.py index c6b9c8694..a15fc6137 100644 --- a/src/backend/core/api/viewsets.py +++ b/src/backend/core/api/viewsets.py @@ -805,7 +805,7 @@ class DocumentViewSet( """Check rules about collaboration.""" if ( not serializer.validated_data.get("websocket", False) - and settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY + and settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY and not self._can_user_edit_document(serializer.instance.id, set_cache=True) ): raise drf.exceptions.PermissionDenied( @@ -825,7 +825,7 @@ class DocumentViewSet( can_edit = ( True - if not settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY + if not settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY else self._can_user_edit_document(document.id) ) @@ -2049,7 +2049,7 @@ class DocumentViewSet( if ( not serializer.validated_data.get("websocket", False) - and settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY + and settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY and not self._can_user_edit_document(document.id, set_cache=True) ): raise drf.exceptions.PermissionDenied( @@ -3071,7 +3071,7 @@ class ConfigView(drf.views.APIView): "AI_FEATURE_LEGACY_ENABLED", "API_USERS_SEARCH_QUERY_MIN_LENGTH", "COLLABORATION_WS_URL", - "COLLABORATION_WS_NOT_CONNECTED_READY_ONLY", + "COLLABORATION_WS_NOT_CONNECTED_READ_ONLY", "COLLABORATION_WS_INACTIVITY_TIMEOUT", "CONVERSION_FILE_EXTENSIONS_ALLOWED", "CONVERSION_FILE_MAX_SIZE", diff --git a/src/backend/core/tests/documents/test_api_documents_can_edit.py b/src/backend/core/tests/documents/test_api_documents_can_edit.py index 05bc39707..f167f033a 100644 --- a/src/backend/core/tests/documents/test_api_documents_can_edit.py +++ b/src/backend/core/tests/documents/test_api_documents_can_edit.py @@ -21,7 +21,7 @@ def test_api_documents_can_edit_anonymous(settings, ws_not_connected_ready_only, session_key = client.session.session_key settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = ws_not_connected_ready_only + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = ws_not_connected_ready_only endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -56,7 +56,7 @@ def test_api_documents_can_edit_authenticated_no_websocket( settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = ws_not_connected_ready_only + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = ws_not_connected_ready_only endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -92,7 +92,7 @@ def test_api_documents_can_edit_authenticated_no_websocket_user_already_editing( settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -127,7 +127,7 @@ def test_api_documents_can_edit_no_websocket_other_user_connected_to_websocket( settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -159,7 +159,7 @@ def test_api_documents_can_edit_user_connected_to_websocket(settings): settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -194,7 +194,7 @@ def test_api_documents_can_edit_websocket_server_unreachable_fallback_to_no_webs settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -229,7 +229,7 @@ def test_api_documents_can_edit_websocket_server_unreachable_fallback_to_no_webs settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -265,7 +265,7 @@ def test_api_documents_can_edit_websocket_server_room_not_found( settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -300,7 +300,7 @@ def test_api_documents_can_edit_websocket_server_room_not_found_other_already_ed settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" diff --git a/src/backend/core/tests/documents/test_api_documents_content_update.py b/src/backend/core/tests/documents/test_api_documents_content_update.py index aaea2c374..b7b876147 100644 --- a/src/backend/core/tests/documents/test_api_documents_content_update.py +++ b/src/backend/core/tests/documents/test_api_documents_content_update.py @@ -269,7 +269,7 @@ def test_api_documents_content_update_authenticated_no_websocket(settings): settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -305,7 +305,7 @@ def test_api_documents_content_update_authenticated_no_websocket_user_already_ed settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -340,7 +340,7 @@ def test_api_documents_content_update_no_websocket_other_user_connected_to_webso settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -374,7 +374,7 @@ def test_api_documents_content_update_user_connected_to_websocket(settings): settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -410,7 +410,7 @@ def test_api_documents_content_update_websocket_server_unreachable_fallback_to_n settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -446,7 +446,7 @@ def test_api_content_update_websocket_server_unreachable_fallback_to_no_websocke settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -481,7 +481,7 @@ def test_api_content_update_websocket_server_room_not_found_fallback_to_no_webso settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -513,7 +513,7 @@ def test_api_documents_content_update_force_websocket_param_to_true(settings): settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -546,7 +546,7 @@ def test_api_documents_content_update_feature_flag_disabled(settings): settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = False + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = False endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" diff --git a/src/backend/core/tests/documents/test_api_documents_update.py b/src/backend/core/tests/documents/test_api_documents_update.py index 27ac8cc3c..29c6d72cf 100644 --- a/src/backend/core/tests/documents/test_api_documents_update.py +++ b/src/backend/core/tests/documents/test_api_documents_update.py @@ -323,7 +323,7 @@ def test_api_documents_update_authenticated_no_websocket(settings): new_document_values["websocket"] = False settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -366,7 +366,7 @@ def test_api_documents_update_authenticated_no_websocket_user_already_editing(se new_document_values["websocket"] = False settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -405,7 +405,7 @@ def test_api_documents_update_no_websocket_other_user_connected_to_websocket(set new_document_values["websocket"] = False settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -443,7 +443,7 @@ def test_api_documents_update_user_connected_to_websocket(settings): new_document_values["websocket"] = False settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -487,7 +487,7 @@ def test_api_documents_update_websocket_server_unreachable_fallback_to_no_websoc new_document_values["websocket"] = False settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -531,7 +531,7 @@ def test_api_documents_update_websocket_server_unreachable_fallback_to_no_websoc new_document_values["websocket"] = False settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -572,7 +572,7 @@ def test_api_documents_update_websocket_server_room_not_found_fallback_to_no_web new_document_values["websocket"] = False settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -650,7 +650,7 @@ def test_api_documents_update_feature_flag_disabled(settings): new_document_values["websocket"] = False settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = False + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = False endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -983,7 +983,7 @@ def test_api_documents_patch_authenticated_no_websocket(settings): settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -1024,7 +1024,7 @@ def test_api_documents_patch_authenticated_no_websocket_user_already_editing(set settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -1059,7 +1059,7 @@ def test_api_documents_patch_no_websocket_other_user_connected_to_websocket(sett settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -1094,7 +1094,7 @@ def test_api_documents_patch_user_connected_to_websocket(settings): settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -1137,7 +1137,7 @@ def test_api_documents_patch_websocket_server_unreachable_fallback_to_no_websock settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -1180,7 +1180,7 @@ def test_api_documents_patch_websocket_server_unreachable_fallback_to_no_websock settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -1217,7 +1217,7 @@ def test_api_documents_patch_websocket_server_room_not_found_fallback_to_no_webs settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -1290,7 +1290,7 @@ def test_api_documents_patch_feature_flag_disabled(settings): settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = False + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = False endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" @@ -1375,7 +1375,7 @@ def test_api_documents_patch_empty_body(settings): settings.COLLABORATION_API_URL = "http://example.com/" settings.COLLABORATION_SERVER_SECRET = "secret-token" - settings.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = True + settings.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = True endpoint_url = ( f"{settings.COLLABORATION_API_URL}get-connections/" f"?room={document.id}&sessionKey={session_key}" diff --git a/src/backend/core/tests/test_api_config.py b/src/backend/core/tests/test_api_config.py index d74a88da1..5f7fef453 100644 --- a/src/backend/core/tests/test_api_config.py +++ b/src/backend/core/tests/test_api_config.py @@ -25,7 +25,7 @@ pytestmark = pytest.mark.django_db AI_FEATURE_LEGACY_ENABLED=False, API_USERS_SEARCH_QUERY_MIN_LENGTH=6, COLLABORATION_WS_URL="http://testcollab/", - COLLABORATION_WS_NOT_CONNECTED_READY_ONLY=True, + COLLABORATION_WS_NOT_CONNECTED_READ_ONLY=True, COLLABORATION_WS_INACTIVITY_TIMEOUT=300, CONVERSION_UPLOAD_ENABLED=False, FRONTEND_CSS_URL="http://testcss/", @@ -56,7 +56,7 @@ def test_api_config(is_authenticated): "AI_FEATURE_LEGACY_ENABLED": False, "API_USERS_SEARCH_QUERY_MIN_LENGTH": 6, "COLLABORATION_WS_URL": "http://testcollab/", - "COLLABORATION_WS_NOT_CONNECTED_READY_ONLY": True, + "COLLABORATION_WS_NOT_CONNECTED_READ_ONLY": True, "COLLABORATION_WS_INACTIVITY_TIMEOUT": 300, "CONVERSION_FILE_EXTENSIONS_ALLOWED": [".docx", ".md"], "CONVERSION_FILE_MAX_SIZE": 20971520, diff --git a/src/backend/impress/settings.py b/src/backend/impress/settings.py index 1932c3219..43f053134 100755 --- a/src/backend/impress/settings.py +++ b/src/backend/impress/settings.py @@ -521,9 +521,13 @@ class Base(Configuration): COLLABORATION_WS_URL = values.Value( None, environ_name="COLLABORATION_WS_URL", environ_prefix=None ) - COLLABORATION_WS_NOT_CONNECTED_READY_ONLY = values.BooleanValue( - False, - environ_name="COLLABORATION_WS_NOT_CONNECTED_READY_ONLY", + COLLABORATION_WS_NOT_CONNECTED_READ_ONLY = values.BooleanValue( + default=values.BooleanValue( # COLLABORATION_WS_NOT_CONNECTED_READY_ONLY compat + default=False, + environ_name="COLLABORATION_WS_NOT_CONNECTED_READY_ONLY", + environ_prefix=None, + ), + environ_name="COLLABORATION_WS_NOT_CONNECTED_READ_ONLY", environ_prefix=None, ) COLLABORATION_WS_INACTIVITY_TIMEOUT = values.IntegerValue( diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-collaboration.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-collaboration.spec.ts index d5c92da8b..9ea0fbd5d 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-collaboration.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-collaboration.spec.ts @@ -150,7 +150,7 @@ test.describe('Doc Collaboration', () => { */ await overrideConfig(page, { COLLABORATION_WS_URL: 'ws://localhost:5555/collaboration/ws/', - COLLABORATION_WS_NOT_CONNECTED_READY_ONLY: true, + COLLABORATION_WS_NOT_CONNECTED_READ_ONLY: true, }); await page.goto('/'); diff --git a/src/frontend/apps/e2e/__tests__/app-impress/utils-common.ts b/src/frontend/apps/e2e/__tests__/app-impress/utils-common.ts index 3bdfdf210..b42785719 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/utils-common.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/utils-common.ts @@ -20,7 +20,7 @@ export const CONFIG = { API_USERS_SEARCH_QUERY_MIN_LENGTH: 3, COLLABORATION_WS_INACTIVITY_TIMEOUT: 15, COLLABORATION_WS_URL: process.env.COLLABORATION_WS_URL, - COLLABORATION_WS_NOT_CONNECTED_READY_ONLY: true, + COLLABORATION_WS_NOT_CONNECTED_READ_ONLY: true, CONVERSION_UPLOAD_ENABLED: true, CONVERSION_FILE_EXTENSIONS_ALLOWED: ['.docx', '.md'], CONVERSION_FILE_MAX_SIZE: 20971520, diff --git a/src/frontend/apps/impress/src/core/config/api/useConfig.tsx b/src/frontend/apps/impress/src/core/config/api/useConfig.tsx index 8f8cd9f6b..b204e5a38 100644 --- a/src/frontend/apps/impress/src/core/config/api/useConfig.tsx +++ b/src/frontend/apps/impress/src/core/config/api/useConfig.tsx @@ -49,7 +49,7 @@ export interface ConfigResponse { AI_FEATURE_LEGACY_ENABLED?: boolean; API_USERS_SEARCH_QUERY_MIN_LENGTH?: number; COLLABORATION_WS_URL?: string; - COLLABORATION_WS_NOT_CONNECTED_READY_ONLY?: boolean; + COLLABORATION_WS_NOT_CONNECTED_READ_ONLY?: boolean; COLLABORATION_WS_INACTIVITY_TIMEOUT?: number | null; CONVERSION_FILE_EXTENSIONS_ALLOWED: string[]; CONVERSION_FILE_MAX_SIZE: number; diff --git a/src/frontend/apps/impress/src/features/docs/doc-management/hooks/useIsCollaborativeEditable.tsx b/src/frontend/apps/impress/src/features/docs/doc-management/hooks/useIsCollaborativeEditable.tsx index 968ee5dec..d2d2f172a 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-management/hooks/useIsCollaborativeEditable.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-management/hooks/useIsCollaborativeEditable.tsx @@ -66,7 +66,7 @@ export const useIsCollaborativeEditable = (doc: Doc) => { setIsLoading(false); }, [_isEditable]); - if (!conf?.COLLABORATION_WS_NOT_CONNECTED_READY_ONLY) { + if (!conf?.COLLABORATION_WS_NOT_CONNECTED_READ_ONLY) { return { isEditable: true, isLoading: false, diff --git a/src/helm/env.d/dev/values.impress.yaml.gotmpl b/src/helm/env.d/dev/values.impress.yaml.gotmpl index ba68c6d87..075025784 100644 --- a/src/helm/env.d/dev/values.impress.yaml.gotmpl +++ b/src/helm/env.d/dev/values.impress.yaml.gotmpl @@ -17,7 +17,7 @@ backend: envVars: COLLABORATION_SERVER_SECRET: my-secret COLLABORATION_API_URL: https://docs.127.0.0.1.nip.io/collaboration/api/ - COLLABORATION_WS_NOT_CONNECTED_READY_ONLY: False + COLLABORATION_WS_NOT_CONNECTED_READ_ONLY: False CONVERSION_UPLOAD_ENABLED: True DJANGO_CSRF_TRUSTED_ORIGINS: https://docs.127.0.0.1.nip.io DJANGO_CONFIGURATION: Feature diff --git a/src/helm/env.d/feature/values.impress.yaml.gotmpl b/src/helm/env.d/feature/values.impress.yaml.gotmpl index fb25acd53..3826b6ab2 100644 --- a/src/helm/env.d/feature/values.impress.yaml.gotmpl +++ b/src/helm/env.d/feature/values.impress.yaml.gotmpl @@ -19,7 +19,7 @@ backend: COLLABORATION_SERVER_SECRET: my-secret CONVERSION_UPLOAD_ENABLED: True COLLABORATION_API_URL: https://{{ .Values.feature }}-docs.{{ .Values.domain }}/collaboration/api/ - COLLABORATION_WS_NOT_CONNECTED_READY_ONLY: True + COLLABORATION_WS_NOT_CONNECTED_READ_ONLY: True DJANGO_CSRF_TRUSTED_ORIGINS: https://{{ .Values.feature }}-docs.{{ .Values.domain }} DJANGO_CONFIGURATION: Feature DJANGO_ALLOWED_HOSTS: {{ .Values.feature }}-docs.{{ .Values.domain }}