fix(configure): dedupe racing plugin-credentials render + pre-fill from current values (#223, #224)#226
Merged
Conversation
…om current values (#223, #224) #223 — Plugin-credentials cards rendered twice. renderPluginCredentials is async (clear → await fetch → append); the double renderAll() at init runs two calls that interleave, so both append (2N cards). Guard with a monotonic generation counter: a call bails after the await if a newer render started, and the clear now happens after the await (right before append) so a superseded render never empties the section. #224 — Plugin-credentials forms were blank after a configure restart. The list endpoint shipped field specs only. The handler now annotates each declared field with its stored state for pre-fill: `configured` (a truthy value is stored) always, plus `value` (verbatim) for NON-secret fields. Secret values never ship — only the boolean — so a secret never round-trips to the browser; the blank-keeps-stored save contract is unchanged. dashboard.js pre-fills non-secret inputs from field.value and keys the secret placeholder off field.configured.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two coupled fixes for the dashboard "Plugin credentials" section (both touch
dashboard.js, so they ship together). Closes #223, closes #224.#223 — cards rendered twice (concurrent render race)
renderPluginCredentials()is async (clear → await fetch → append). The doublerenderAll()at init runs two calls that interleave, so both append → every card twice.pluginRenderSeqgeneration counter: a call bails after the await if a newer render started, so only the latest result appends.container.textContent = ""moved to after the await (right before append) so a superseded render never empties the section.#224 — forms blank after restart (no read-back)
The list endpoint shipped field specs only, so the form had nothing to pre-fill.
configured(truthy value stored) always;value(verbatim) for non-secret fields only.dashboard.jspre-fills non-secret inputs fromfield.valueand keys the secret placeholder offfield.configured.Security
"SECRET" not in json.dumps(body)); only a booleanconfiguredflag is exposed.Test plan
configured+valueverbatim; secretconfiguredonly, novalue; unset → not configured; secret value absent from whole payloadfield.value/field.configuredpre-fillruff+black --check mureo/+mypy mureo/cleanNote: the one local-only
test_mcp_server_plugin_wiringfailure is the dev venv's installed bridge adding plugins; passes in clean CI.