Skip to content

fix(admin): don't request update status when updates.tier is off - #8580

Merged
JohnMcLear merged 4 commits into
developfrom
fix/8573-admin-updates-off
Nov 28, 2026
Merged

JohnMcLear merged 4 commits into
developfrom
fix/8573-admin-updates-off

Conversation

@JohnMcLear

Copy link
Copy Markdown
Member

Refs #8573. This is a follow-up to #8579, which does the same for the pad client. It does not depend on that PR.

When updates.tier is "off" the server does not register /admin/update/status, but the admin banner and update page still requested it. Because of the admin SPA catch-all, that request came back as HTML with a 200, so the update page showed "Could not load update status".

The tier now comes with the existing /settings socket payload as flags.updatesTier, next to gdprAuthorErasure. The banner and update page wait for it, and if the tier is "off" they never call the status route. I chose this over keeping the route registered and returning {tier:'off'} for three reasons:

  • the tier-off contract stays "no updater HTTP surface"
  • the payload only goes to authenticated admin sockets. The status route is public by default, so the other option would tell anyone that an instance won't hear about updates
  • the socket path already works behind a proxy path

With the tier off, admins see a non-alarming notice instead. It says update notifications are off, so you may not hear about security updates, and explains how to turn them back on: updates.tier in settings.json, or UPDATES_TIER. It also links to the update docs. The banner can be dismissed for the browser session. The update page always shows the notice.

privacy.updateCheck: false made the troubleshooting page say "Update available: undefined". The help payload now includes versionCheck, and when it is off the page says the latest-version check is off.

Other changes:

  • Strings use i18n. New en keys update.off.* and admin_plugins_info.version_check_off. The existing update.page.disabled key is reused as the notice heading.
  • The docs URL is built at runtime. The proxy-path rewrite turns every literal /admin in the bundle into <proxy>/admin, which would break an external docs.etherpad.org/admin/... link. A test covers this.
  • Tests: a backend spec for flags.updatesTier on every tier, including the hidden-settings case, and for versionCheck. A Playwright admin spec checks that no request goes to /admin/update/status, that the notice and dismiss work, that the help page is right, and that the docs link survives the proxy rewrite.
  • Docs (doc/admin/updates.md) and a CHANGELOG 3.3.23 entry. fix: skip client version check when updates tier is off #8579 also creates the 3.3.23 section, so whichever PR merges second needs a trivial merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TcYAoDMav4BPPE9JrMtSvw

The server does not register /admin/update/status when updates.tier is
"off", but the admin banner and update page still requested it. The
admin UI now reads the tier from the /settings socket payload
(flags.updatesTier) and skips the request. It shows a notice instead:
update notifications are off, so you may not hear about security
updates, plus how to turn them back on (updates.tier / UPDATES_TIER) and
a link to the docs.

The troubleshooting page no longer shows "Update available: undefined"
when privacy.updateCheck is false.

Refs #8573

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TcYAoDMav4BPPE9JrMtSvw
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Avoid admin update-status requests when updates are off

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Read the update tier from the admin settings socket before requesting update status.
• Show a dismissible notice when updates are off, without calling the unregistered status route.
• Correct troubleshooting output when version checks are disabled, with tests and documentation.
Merge Risk 🟡 Medium

Blast radius 🟡 Medium 💥 2 capabilities

  • 2 affected capabilities within one bounded functional scope: admin-update-management.
  • The banner and update page are two presentation surfaces for the same bounded admin update-management integration.
  • Both consume the tier and status supplied through the settings socket and update-status endpoint, so they remain one end-to-end capability rather than independent technical layers.
  • This is a distinct admin outcome—diagnosing the installed version and whether a latest-version check is available—but it remains within the same bounded admin update-management integration as the update page because both are fed by the server's update configuration and version-check data.
Behavioral complexity 🟡 Medium 🧩 Interacting branches

  • Before, the banner and update page independently fetched status and handled route errors.
  • After, both depend on an asynchronously delivered tier, with separate loading/off/active branches, in-flight request guards, polling cancellation, and session dismissal.
  • The new correctness condition is that tier arrival and tier changes must not leave stale status requests, stale results, duplicate notices, or an indefinitely loading page.
  • The socket-to-client contract is directly evidenced; deployment exposure remains unknown but is not needed for the behavior classification.
Potential damage 🟡 Medium 🩹 Temporary loss

  • If this changed behavior regresses, admins may lose update status or notifications, or may see the disabled notice at the wrong time.
  • The updater itself and stored update state are not changed by these UI paths.
  • Reverting the code restores behavior; no persistent-state repair or external compensation is indicated.
  • A code revert restores the prior UI behavior.
  • If a wrong gate prevents an administrator from learning about a release during the interval, the missed notification requires the administrator to revisit the update page or receive a later notification; no automatic notification replay is established by this PR.
Assessed commit 6c878f1
Diagram

graph TD
  A["Settings socket"] --> B["Tier store"] --> C{"Tier off?"}
  C -->|Yes| D["Off notice"] --> F["Admin views"]
  C -->|No| E["Status route"] --> F
  G["Help payload"] --> H["Help page"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep the status route registered for the off tier
  • ➕ Would let existing admin clients read an explicit off response without a settings-socket dependency.
  • ➖ Would expand the updater HTTP surface when the tier is off.
  • ➖ The status route can be public, exposing the instance's update-notification setting.

Recommendation: Use the existing authenticated settings socket as proposed. It preserves the off tier's lack of an updater status route, works with the existing proxy-path handling, and gives both admin views a shared decision point.

Files changed (14) +420 / -16

Enhancement (4) +76 / -0
UpdatesOffNotice.tsxAdd a reusable updates-off notice +37/-0

Add a reusable updates-off notice

• Explains the security-notification implications and how to re-enable updates. Builds the external documentation URL at runtime to avoid proxy-path bundle rewriting.

admin/src/components/UpdatesOffNotice.tsx

index.cssStyle the informational off notice +27/-0

Style the informational off notice

• Adds distinct, non-alarming notice styling and a dismiss button.

admin/src/index.css

store.tsShare the update tier across admin views +7/-0

Share the update tier across admin views

• Adds nullable updatesTier state and a setter; null represents a tier that has not yet arrived.

admin/src/store/store.ts

en.jsonAdd localized off-notice and help text +5/-0

Add localized off-notice and help text

• Adds English strings for the update-off explanation, restoration steps, documentation link, dismissal, and disabled version check.

src/locales/en.json

Bug fix (6) +76 / -16
App.tsxCapture the update tier from admin settings +3/-0

Capture the update tier from admin settings

• Stores flags.updatesTier from the settings socket payload so admin views can decide whether to request update status.

admin/src/App.tsx

UpdateBanner.tsxGate banner requests and show a session-dismissible notice +27/-2

Gate banner requests and show a session-dismissible notice

• Waits for a known tier and skips the status request when it is off. Shows the shared notice outside the update page and remembers dismissal in session storage.

admin/src/components/UpdateBanner.tsx

HelpPage.tsxHandle disabled or unavailable version checks +20/-9

Handle disabled or unavailable version checks

• Shows a dedicated message when the legacy version check is off. Avoids comparing or displaying an undefined latest version.

admin/src/pages/HelpPage.tsx

Plugin.tsRepresent optional latest-version help data +4/-1

Represent optional latest-version help data

• Makes latestVersion optional and adds versionCheck to the help payload type.

admin/src/pages/Plugin.ts

UpdatePage.tsxSkip status loading when the update tier is off +15/-4

Skip status loading when the update tier is off

• Waits for the settings-socket tier before fetching status. Displays the shared off notice instead of requesting the unregistered route.

admin/src/pages/UpdatePage.tsx

adminsettings.tsExpose update and version-check flags to admin sockets +7/-0

Expose update and version-check flags to admin sockets

• Includes updatesTier in settings flags even when the settings page is hidden. Adds versionCheck to the help response so the UI can identify a disabled legacy check.

src/node/hooks/express/adminsettings.ts

Tests (2) +260 / -0
updatesTierFlag.tsTest admin socket update flags +133/-0

Test admin socket update flags

• Checks tier reporting across all supported tiers and with hidden settings. Verifies help payload behavior with the legacy version check on and off.

src/tests/backend/specs/admin/updatesTierFlag.ts

update-tier-off.spec.tsTest update-off admin workflows +127/-0

Test update-off admin workflows

• Uses a rewritten settings socket payload to verify notices, dismissal, help text, and absence of status requests. Checks that the external documentation link survives proxy-path rewriting.

src/tests/frontend-new/admin-spec/update-tier-off.spec.ts

Documentation (2) +8 / -0
CHANGELOG.mdDocument the admin update-off fix for 3.3.23 +6/-0

Document the admin update-off fix for 3.3.23

• Adds a notable fix entry covering the skipped status request, admin notice, and troubleshooting correction.

CHANGELOG.md

updates.mdExplain admin behavior when updates are off +2/-0

Explain admin behavior when updates are off

• Documents the notice, session dismissal, settings needed to restore notifications, and troubleshooting behavior when the legacy check is disabled.

doc/admin/updates.md

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Disabled updates can keep being polled ✓ Resolved
Description
UpdatePage gates its initial status fetch on updatesTier, but its separate in-flight polling
effect still calls refreshStatus() without checking that tier. If the tier becomes off while an
in-flight status remains cached, the page continues requesting /admin/update/status once per
second even though the route is no longer registered.

2. The disabled notice can disappear ✓ Resolved
Description
UpdatePage sets fetchState to disabled when the tier turns off, but an earlier
refreshStatus() can subsequently overwrite that state because the effect's cancellation flag does
not guard its updates. When a status request is pending across a tier change, its response or
failure can replace the notice with an error or cached status actions.

3. Update banner and page stall without settings.json ✓ Resolved
Description
The admin settings socket’s load handler sends flags.updatesTier only after
fsp.readFile(settings.settingsFilename) succeeds and returns without emitting flags when the read
fails. When Etherpad runs on defaults without a settings file, the tier remains null, so
UpdateBanner does not request status and UpdatePage remains on 'loading' even though the status
route is available.

Grey Divider

Tip of the day
💡 Did you know, you can turn these tips off under Display > Comment parts

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

JohnMcLear and others added 3 commits November 27, 2026 10:24
Address review findings on #8580:
- the /settings socket emits `updatesTier` on connect, so the update UI
  still gets the tier when settings.json can't be read and `load` emits
  nothing
- the update page's in-flight polling stops when the tier is "off", and a
  status request started before that can't overwrite the notice

Refs #8573

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TcYAoDMav4BPPE9JrMtSvw
@JohnMcLear
JohnMcLear merged commit 0fc4426 into develop Nov 28, 2026
43 checks passed
@JohnMcLear
JohnMcLear deleted the fix/8573-admin-updates-off branch November 28, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant