diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py index 8fe3a98864b28c1f8c9ab575fbc1ee61dfdc8ae6..6b0d69ba99df8b4cc97f182ed782d29f1a304b59 100644 --- a/homeassistant/components/frontend/__init__.py +++ b/homeassistant/components/frontend/__init__.py @@ -398,7 +398,10 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: static_paths_configs: list[StaticPathConfig] = [] for path, should_cache in ( - ("service_worker.js", False), + ("sw-modern.js", False), + ("sw-modern.js.map", False), + ("sw-legacy.js", False), + ("sw-legacy.js.map", False), ("robots.txt", False), ("onboarding.html", not is_dev), ("static", not is_dev), diff --git a/homeassistant/components/frontend/manifest.json b/homeassistant/components/frontend/manifest.json index 57de177da9c2282123a5b95083e08838fb4460be..d7253b52b286058f72d97fbecf60b8fceb0eb3b2 100644 --- a/homeassistant/components/frontend/manifest.json +++ b/homeassistant/components/frontend/manifest.json @@ -20,5 +20,5 @@ "documentation": "https://www.home-assistant.io/integrations/frontend", "integration_type": "system", "quality_scale": "internal", - "requirements": ["home-assistant-frontend==20240710.0"] + "requirements": ["home-assistant-frontend==20240719.0"] } diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 2509737d87a30d930c02a9352b538730b0e3116e..16d72eb03d34ce29be6573aa4b0b983586766dda 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -32,7 +32,7 @@ habluetooth==3.1.3 hass-nabucasa==0.81.1 hassil==1.7.4 home-assistant-bluetooth==1.12.2 -home-assistant-frontend==20240710.0 +home-assistant-frontend==20240719.0 home-assistant-intents==2024.7.10 httpx==0.27.0 ifaddr==0.2.0 diff --git a/requirements_all.txt b/requirements_all.txt index d69638f9d88fe09372aa298aa0874820b0eb386a..7b9fcd6ae18abef2518d139098806f9911f49b7d 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1087,7 +1087,7 @@ hole==0.8.0 holidays==0.53 # homeassistant.components.frontend -home-assistant-frontend==20240710.0 +home-assistant-frontend==20240719.0 # homeassistant.components.conversation home-assistant-intents==2024.7.10 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index f7271b6fbe042b69721f6906a1bf7b30546bd9e2..1c37da543c0a53913334b2a51dff17a812cb886d 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -904,7 +904,7 @@ hole==0.8.0 holidays==0.53 # homeassistant.components.frontend -home-assistant-frontend==20240710.0 +home-assistant-frontend==20240719.0 # homeassistant.components.conversation home-assistant-intents==2024.7.10 diff --git a/tests/components/frontend/test_init.py b/tests/components/frontend/test_init.py index 0856d81e205d95420e1f22fee196d4aacffa8283..5006adedd77ffaeb3be62657069be0808623ae57 100644 --- a/tests/components/frontend/test_init.py +++ b/tests/components/frontend/test_init.py @@ -174,9 +174,12 @@ async def test_frontend_and_static(mock_http_client: TestClient) -> None: assert "public" in resp.headers.get("cache-control") -async def test_dont_cache_service_worker(mock_http_client: TestClient) -> None: +@pytest.mark.parametrize("sw_url", ["/sw-modern.js", "/sw-legacy.js"]) +async def test_dont_cache_service_worker( + mock_http_client: TestClient, sw_url: str +) -> None: """Test that we don't cache the service worker.""" - resp = await mock_http_client.get("/service_worker.js") + resp = await mock_http_client.get(sw_url) assert resp.status == 200 assert "cache-control" not in resp.headers