Repository navigation
fix(dashboard): batch delete no longer toasts failure after success - #12711
diegosouzapw merged 2 commits into
Conversation
79f5c96 to
6aac03b
Compare
|
Technical review (LOCAL, HOLD, 0 CONFIRMED, 2 UNCERTAIN. Not restarting rounds. Adjudication:
CI remaining: merge-integrity ( Contributor only — not merging. |
6aac03b to
f4eba70
Compare
|
Rebased onto range-diff every unique commit Own tests re-run on the new base.
|
cb6a70c to
45c6452
Compare
ConfirmModal binds onConfirm to Button onClick, so the click MouseEvent was forwarded into handleBatchDeleteConfirm's optional onAfter. After a 200, the success toast fired and then `await onAfter()` threw, which the catch treated as a network error. Treat onAfter as a callback only when it is a function, and stop forwarding the click event from ConfirmModal. Signed-off-by: Minxi Hou <houminxi@gmail.com>
Cherry-pick onto the deploy recut conflicted with cheaper-inference#12770 on open-sse/executors/glm.ts. This PR only fixes ConfirmModal forwarding the click event into onAfter. Restore glm.ts to the release tip so the arity fix stays on cheaper-inference#12770. Signed-off-by: Minxi Hou <houminxi@gmail.com>
45c6452 to
b3503bc
Compare
|
Rebased onto
|
Validado numa worktree combinada com as 16 PRs desta leva sobre `release/v3.8.51`: typecheck:core limpo, check-file-size e check-changelog-integrity OK, complexity 2788/3218 e cognitive 1261/1437 (ambos sob a baseline), ESLint 0 erros nos 152 arquivos alterados, 771 testes unitários focados, 49 de integração e a suíte vitest:ui completa (2149) verdes. O `65536` era o 16º posicional de um helper com 15 parâmetros — `TS2554` vivo no tip (`open-sse/executors/glm.ts:244`, confirmado aqui antes do board). O teste de guarda de aridade é o que impede a reincidência: ele checa a assinatura do helper e o call site, não o comportamento, que é exatamente onde o erro morava. Obrigado por isolar isso do #12711 em vez de deixar o `glm.ts` viajar junto com pin/combo-split/moonshot.
25bc16d
into
cheaper-inference:release/v3.8.51
…nce#12770) Validado numa worktree combinada com as 16 PRs desta leva sobre `release/v3.8.51`: typecheck:core limpo, check-file-size e check-changelog-integrity OK, complexity 2788/3218 e cognitive 1261/1437 (ambos sob a baseline), ESLint 0 erros nos 152 arquivos alterados, 771 testes unitários focados, 49 de integração e a suíte vitest:ui completa (2149) verdes. O `65536` era o 16º posicional de um helper com 15 parâmetros — `TS2554` vivo no tip (`open-sse/executors/glm.ts:244`, confirmado aqui antes do board). O teste de guarda de aridade é o que impede a reincidência: ele checa a assinatura do helper e o call site, não o comportamento, que é exatamente onde o erro morava. Obrigado por isolar isso do cheaper-inference#12711 em vez de deixar o `glm.ts` viajar junto com pin/combo-split/moonshot.
…heaper-inference#12711) Validado numa worktree combinada com as 16 PRs desta leva sobre `release/v3.8.51`: typecheck:core limpo, check-file-size e check-changelog-integrity OK, complexity 2788/3218 e cognitive 1261/1437 (ambos sob a baseline), ESLint 0 erros nos 152 arquivos alterados, 771 testes unitários focados, 49 de integração e a suíte vitest:ui completa (2149) verdes. Além do bug do toast, esta PR foi a que derrubou os três base-reds vivos do tip: o fragmento `changelog.d/fixes/reset-aware-model-family.md` sem o `- ` inicial, o registro do `tests/unit/reset-aware-request-scope-12600.test.ts` no `stryker.conf.json` e o `TS2554` do glm. O `check-changelog-integrity` voltou a passar aqui por causa dela. O diagnóstico do MouseEvent é o que dá o valor: `onConfirm` chegava como handler de clique nativo e `handleBatchDeleteConfirm` tratava qualquer primeiro argumento truthy como callback. O cinto (`typeof`) e o suspensório (o wrap no ConfirmModal) juntos estão certos — só um dos dois deixaria a porta aberta para o próximo caller.
…agment (cheaper-inference#13200) Um caractere. O fragmento do cheaper-inference#13097 subiu sem o `- ` inicial e derrubou o `Merge integrity` para todo mundo que veio depois. Terceira ocorrência da mesma causa nesta release; a anterior foi o `reset-aware-model-family.md`, que o cheaper-inference#12711 consertou de carona.
Bug
On the provider detail page, bulk-deleting API keys (moonshot-native in this case) shows "deleted N connections" and then immediately "network error during batch delete". The keys are actually gone. The failure toast is a lie.
Fixes: dashboard bulk-delete success+failure toast pair.
Root Cause
ConfirmModalbindsonConfirmto<Button onClick={onConfirm}>. A native click passes a MouseEvent.handleBatchDeleteConfirm(onAfter?)treated any truthy first argument as a post-delete callback. After DELETE 200 it toasted success, thenawait onAfter()invoked the MouseEvent object, which throws, and the catch toastedbatchDeleteNetworkError.API side is fine:
DELETE /api/providerswith{ ids }returns 200 and deletes the rows. The second toast is UI-only.Measured 2026-09-04 against
handleBatchDeleteConfirm+ ConfirmModal wiring. Reproduction: pass a{ type: "click" }stand-in as the first argument after a 200; success fires, then the network-error toast.Fix
onAfteronly whentypeof onAfter === "function".onClick={() => void onConfirm()}so the event never reaches the handler.How to Verify
Test Plan
tests/unit/ui/batch-delete-click-event.test.tsx— click-event stand-in after 200 does not toast error; a realonAfterstill runstypeofcheck → the click-event case goes red; restore → greentests/unit/ui/confirm-delete-connection-7361.test.tsxstill 3/3tests/unit/providers-route-managed-catalog.test.tsstill 6/6 (includes batch DELETE)Risk
Low. ConfirmModal still calls
onConfirm()with no args, which matches its type (() => void | Promise<void>).onAfteris unused in production callers today; the typeof guard is the belt, the ConfirmModal wrap is the suspenders.Not in this PR
No chunking of DELETE past the existing 100-id API cap. Activate/deactivate already chunk; delete does not. Separate if you bulk-delete >100 at once.
Also in this commit (base hygiene that blocked CI)
useProviderConnectionsarg as_isSearchProvider(eslint@typescript-eslint/no-unused-varson the file this PR already touches).changelog.d/fixes/reset-aware-model-family.mdnow starts with-(fragment gate).tests/unit/reset-aware-request-scope-12600.test.tsinstryker.conf.jsontap.testFiles(mutation-test-coverage --strict).open-sse/executors/glm.ts: drop the extra 16th arg tocreateSSETransformStreamWithLogger(TS2554; the 65536 never reached TransformStream).Not in this PR: HuggingChat/stream public-error unit failures on
release/v3.8.51, and local-only forgedaemon_state(.code-forge/is gitignored).