Commit 8b8b88c
fix(plugins): tolerate whitespace/NBSP in safe_uninstall confirmation phrase
Davidson typed the exact required phrase ("EXCLUIR PLUGIN NUTRI") in the
uninstall wizard and got back 400 confirmation_phrase_mismatch. Strict ==
comparison was punishing the user for an invisible character (likely an
NBSP from copy-paste or a trailing whitespace from autofill — the kind of
thing operators can't see and shouldn't have to debug).
Backend (routes/plugins.py uninstall handler)
- Normalize both sides with unicodedata.normalize("NFC") + strip + replace
NBSP with regular space before comparing. The phrase is a human-typed
confirmation token, not a cryptographic key — tolerance is appropriate.
- Mismatch response now also returns expected/received raw values + lengths,
so the wizard (or operator inspecting the response) can see the actual diff.
Frontend (components/PluginUninstall.tsx)
- Same normalisation client-side, applied both to the gate (typedPhrase ===
required check) and to the body sent to the backend. The user no longer
has to hunt for an invisible character.
Direct push to develop per Davidson's instruction (no PR needed for this
small UX fix).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d58c492 commit 8b8b88c
2 files changed
Lines changed: 30 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1274 | 1274 | | |
1275 | 1275 | | |
1276 | 1276 | | |
1277 | | - | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
1278 | 1291 | | |
1279 | 1292 | | |
1280 | 1293 | | |
1281 | 1294 | | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
1282 | 1299 | | |
1283 | 1300 | | |
1284 | 1301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
71 | | - | |
| 78 | + | |
| 79 | + | |
72 | 80 | | |
73 | 81 | | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
78 | 86 | | |
79 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
80 | 90 | | |
81 | 91 | | |
82 | 92 | | |
| |||
0 commit comments