diff --git a/.github/workflows/github_build_release.yml b/.github/workflows/github_build_release.yml index 66a54656..cc2e3fe5 100644 --- a/.github/workflows/github_build_release.yml +++ b/.github/workflows/github_build_release.yml @@ -76,12 +76,19 @@ jobs: launch.json - name: Write release.json + # The copy at public/client/release.json is DEPRECATED: it exists only + # to provide an upgrade path for still-running 2.x screen clients, + # which poll /client/release.json. Without it the Symfony catch-all + # /client{subroutes} route answers with the SPA's index.html and 2.x + # screens never detect the new release. Remove once 2.x clients are + # out of the field. run: | printf '{"releaseTimestamp": %s, "releaseTime": "%s", "releaseVersion": "%s"}\n' \ "$(date +%s)" \ "$(date -u)" \ "${{ github.ref_name }}" \ > public/release.json + cp public/release.json public/client/release.json cat public/release.json - name: Make assets dir diff --git a/.gitignore b/.gitignore index 16b605cf..d0de6920 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,9 @@ # Ignore the public/fixtures folder. /public/fixtures -# Ignore release json file. +# Ignore release json file (and its deprecated copy for the 2.x client upgrade path). /public/release.json +/public/client/release.json ###> symfony/framework-bundle ### /.env.local diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ef46129..127fbf12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +- Fixed the 2.x → 3.0 screen client auto-upgrade path: ship a copy of `release.json` at the + deprecated `/client/release.json` location polled by 2.x clients. Without it the catch-all + `/client` route answered with the SPA's HTML and already-running 2.x screens never detected + the new release (manual reload of every screen was required). The copy is deprecated and + will be removed once 2.x clients are out of the field. See `UPGRADE.md`. - Hardened server-side outage handling so API clients (e.g. the screen client) can tell a temporary outage from an authentication failure and avoid logging out: - Database connectivity failures (Doctrine DBAL `ConnectionException`) now surface as diff --git a/UPGRADE.md b/UPGRADE.md index 880e627c..e16df064 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -289,3 +289,24 @@ docker compose exec phpfpm bin/console app:feed:remove-deprecated-feed-sources - ``` Event database feeds should be recreated using `EventDatabaseApiV2FeedType`. + +#### 9 - Screen client auto-upgrade + +Running 2.x screen clients poll `/client/release.json` to detect new releases and reload +themselves. In 3.0 the release file lives at `/release.json` (site root); the old path is +a catch-all route serving the client SPA, so without further action 2.x screens would +never detect the upgrade and would need a manual reload. + +The 3.0 images and release tarball therefore ship a copy at `public/client/release.json`. +**This location is deprecated** and will be removed once 2.x clients are out of the field. +With those deploys, running 2.x screens reload into the 3.0 client on their next release +check (every 10 minutes by default) — no operator action required. + +If you deploy from source instead, nothing generates the release file — your deploy +process must write it (shape per `docs/release-example.json`): + +```shell +printf '{"releaseTimestamp": %s, "releaseTime": "%s", "releaseVersion": "%s"}\n' \ + "$(date +%s)" "$(date -u)" "" > public/release.json +cp public/release.json public/client/release.json +``` diff --git a/infrastructure/display-api-service/Dockerfile b/infrastructure/display-api-service/Dockerfile index 18263c4f..3f07891c 100644 --- a/infrastructure/display-api-service/Dockerfile +++ b/infrastructure/display-api-service/Dockerfile @@ -77,11 +77,18 @@ RUN APP_ENV=prod composer install --no-dev --optimize-autoloader --classmap-auth # The client polls /release.json to detect when a screen should refresh; # shape per docs/release-example.json. +# +# DEPRECATED: the copy at /client/release.json exists only to provide an +# upgrade path for still-running 2.x screen clients, which poll that path. +# Without it the Symfony catch-all /client{subroutes} route answers with the +# SPA's index.html and 2.x screens never detect the new release. Remove once +# 2.x clients are out of the field. RUN printf '{"releaseTimestamp": %s, "releaseTime": "%s", "releaseVersion": "%s"}\n' \ "${APP_RELEASE_TIMESTAMP}" \ "${APP_RELEASE_TIME}" \ "${APP_VERSION}" \ - > public/release.json + > public/release.json \ + && cp public/release.json public/client/release.json ################################