feat(settings): default settings.enablePluginPadOptions to true#7841
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Review Summary by QodoDefault enablePluginPadOptions to true for plugin compatibility
WalkthroughsDescription• Default settings.enablePluginPadOptions from false to true • Aligns with original 3.0.0 intent for plugin pad-wide options • Suppresses console warnings on fresh deployments • Updates documentation and test labels to reflect opt-out model Diagramflowchart LR
A["enablePluginPadOptions: false<br/>(old default)"] -->|"flip to true"| B["enablePluginPadOptions: true<br/>(new default)"]
B -->|"plugins like ep_plugin_helpers"| C["Pad-wide options work<br/>out of the box"]
B -->|"operators can opt-out"| D["Set to false in<br/>settings.json"]
A -->|"caused warnings"| E["console.warn on pad load"]
C -->|"eliminates"| E
File Changes1. src/node/utils/Settings.ts
|
Code Review by Qodo
1. Default flip breaks upgrades
|
ether/etherpad#7841 flips settings.enablePluginPadOptions default to true, turning the runtime gate from opt-in into opt-out. Update the helper's README + source comments so the framing matches: - README PadToggle section: requires the patch (3.0.0+) AND the flag not be explicitly false; calls out that older 3.x cores shipped it default false so operators on those versions still need the explicit opt-in. - pad-toggle-server.js / pad-toggle.js / pad-select-server.js comment blocks: remove the "default false per AGENTS.MD §52" framing; describe the post-flip default and explicit operator opt-out as the case where the warning fires. Behavior unchanged — runtime flag detection still reads clientVars.runtimeEnabled and warns when it's false; the warning copy itself ("settings.enablePluginPadOptions is false — set to true …") stays correct for operators who've explicitly disabled. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
CI note: the two Windows backend test failures (`Windows with Plugins (24)` and `Windows without plugins (24)`) are the pre-existing silent-ELIFECYCLE flake on Windows runners — each run dies at a different test file (this one died inside `messages.ts USER_CHANGES` and `socketio.ts Pad-wide settings creator gate`, neither of which touches `enablePluginPadOptions`). The develop tip itself (sha `d9dabe35`) fails `Windows without plugins (24)` the same way 30 min before this PR was opened. Every Linux variant (with + without plugins, plus 24-only matrix), Playwright Chrome ×2, Playwright Chrome with plugins, Playwright Firefox, Wrapper unit, perform type check, build, build-test, build-test-local-plugin, test, Analyze, CodeQL, Build snap (destructive-mode), and dependency-review all pass. Heartbeat instrumentation to surface the silent Windows failure root cause is queued in #7838. |
…7842) * test(ci): schedule a mid-test snapshot 150ms after every beforeEach Run 26401801404 (PR #7841 after merging develop) captured the dying test's beforeEach node-report — be-0258, written 75ms after socketio.ts > "Pad-wide settings creator gate different browsers" entered — but no further state. The kill landed 321ms into the test body, between 1 Hz heartbeat ticks, and the 100ms boundary throttle prevented further beforeEach writes inside the same test. The report we have shows only the listening server socket; the connections that the test body creates (and that presumably precede the kill) never get snapshotted. Schedule an unref'd setTimeout from beforeEach that fires 150ms after the test entered. If it's still the running test at fire time (i.e. slow enough that the death window applies), capture a node-report from INSIDE the test body — the moment when the real TCP / socket.io activity is in flight. Fast tests (<150ms) skip the write because afterEach has already cleared currentTest by the time the timer fires. Result on the next reproduction of the death pattern: - be-NNNN report at +75ms (beforeEach, body not yet started) - mt-MMMM report at +150ms (mid-test, body in flight, before kill at +320ms) - kill, no further reports Cost: only slow tests (>150ms) generate an mt report, so the artifact size growth is bounded by the count of tests that take longer than 150ms — typically a small minority. Locally verified against a 3-test probe: 2 fast tests skipped, 1 300ms test produced the expected mt-NNNN snapshot. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test(ci): bump heartbeat from 1Hz to 5Hz Run 26402211271 produced be-0207 (the dying test's beforeEach snapshot) but no mid-test snapshot, even though setTimeout(150ms) was scheduled and the test body lived another 280 ms after that deadline. setTimeout under Windows-runner load is being starved past the deadline — we already saw the previous test's mt fire at +252 ms (102 ms late) when the deadline was 150 ms, so the dying test's timer was likely scheduled to fire well after the kill at +425 ms. setInterval has fired reliably throughout the investigation (every heartbeat in every run lands within ~1 s of schedule, even when setTimeout misses). Bump heartbeat to 200 ms (5 Hz) so any death window ≥200 ms is sampled inside the test body, independent of how starved setTimeout is. Cost on the Windows runner: the existing log shows writeReport completes in <1 ms (from "Writing Node.js report" to "Node.js report completed" timestamps), so 5 Hz adds ~5 ms/s of overhead. Artifact growth: ~500 reports for a 100 s test phase (~25 MB raw, ~5 MB compressed). The setTimeout mid-test snapshot stays — it's belt-and-suspenders cheap and fires for slow tests where the heartbeat alone might not align with the death window. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix: isolate mt/hb writes from `be` throttle + gate timer on canWriteReport Qodo flagged two real issues on #7842: 1. The single shared `lastReportT` made `mt` writes poison the `be` throttle window. Slow tests trigger an `mt` write at +150 ms, then the test ends a few ms later, and the NEXT test's `beforeEach` landed within the 100 ms throttle from the `mt` write — so its own `be` snapshot was suppressed. That's the exact boundary coverage the throttle is supposed to PROTECT. Local repro with a 180 ms slow test followed by a fast one confirmed: the fast test's `be-0004` is now captured instead of swallowed. Fix: split into `lastBoundaryT` used and updated only by `be` writes. `hb` and `mt` pass `updateThrottle=false` and never advance the boundary timestamp. 2. `setTimeout` was being scheduled in `beforeEach` for every test even when `canWriteReport` is false (Linux backend matrix, local dev). That's a wasted timer per test for no possible diagnostic output. Gate the schedule itself on `canWriteReport`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This flag gates the ep_* passthrough on padoptions that shipped in 3.0.0 (PR #7698). It was introduced as opt-in, but the intent in shipping it was to let plugins like ep_plugin_helpers' padToggle / padSelect ride the existing broadcast/persist rail out of the box — flipping the default closes the gap. Why now - ep_comments_page#422 (and sibling per-plugin reports discussed on Discord): stock 3.x deployments console.warn on every pad load because the helper detects clientVars.enablePluginPadOptions === false and tells the admin to flip it. With the flag default-true, the warning stops firing on fresh installs while still surfacing for operators who have explicitly opted out. - Plugins that already depend on ep_plugin_helpers >= 0.6 expect the pad-wide path to work; the default-false gate silently no-op'd pad.changePadOption('ep_*', …) and made the helper UI inert. Scope - Settings.ts default flipped to true; comment rewritten to describe the new "operator opt-out" model rather than the old AGENTS.MD §52 opt-in framing (that policy still applies to *new* features; this one has shipped and proven safe). - settings.json.template env-var substitution default flipped to true so docker / supervisor configs without an explicit value get the new behavior. - doc/plugins.md updated to match (default true, opt-out via settings.json) and the PluginCapabilities source comment. - Backend test describe-blocks relabeled — "true" is now "(default)", "false" is now "(operator opt-out)". Both branches still cover the same matrix so the size-cap / namespace-validation paths stay exercised. Compat - Existing deployments with an explicit `"enablePluginPadOptions": false` in settings.json keep that value — no migration needed. - Older clients only read clientVars.enablePluginPadOptions; the protocol shape is unchanged. Closes ep_comments_page#422 (helper warning suppression for stock deployments). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9d0c739 to
438fc43
Compare
Note to Sam: This is more of a fix than a feat, it's the pad wide setting for plugins enabled by default as I intended but messed it up :)
Summary
settings.enablePluginPadOptionsdefault fromfalse→true. Matches the original intent of shipping theep_*passthrough in 3.0.0 (PR feat(padOptions): pass plugin-namespaced ep_* keys through applyPadSettings #7698): let plugins likeep_plugin_helpers'padToggle/padSelectride the existingpadoptionsbroadcast/persist rail out of the box.Settings.ts,settings.json.template(env-var default),PluginCapabilities.tscomment, anddoc/plugins.md(now describes the flag as opt-out instead of opt-in).trueis now(default),falseis now(operator opt-out). Same matrix; both branches still pass.Why now
console.warnon every pad load becauseep_plugin_helpersdetectsclientVars.enablePluginPadOptions === falseand tells the admin to flip it. With the flag default-true, the warning stops firing on fresh installs while still surfacing for operators who have explicitly opted out.ep_plugin_helpers >= 0.6already expect pad-wide options to work; default-false silently no-op'dpad.changePadOption('ep_*', …)and made the helper UI inert.Compat
"enablePluginPadOptions": falseinsettings.jsonkeep that value — no migration.clientVarsshape is unchanged; older clients only readenablePluginPadOptionsand keep working.Follow-up
Closes ether/ep_comments_page#422 (warning suppression for stock deployments).
Test plan
mocha tests/backend/specs/Pad.ts— 31 passing, both(default)and(operator opt-out)branches greensettings.json(env-var path) to confirmclientVars.enablePluginPadOptions === trueon default deploy🤖 Generated with Claude Code