Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(control-ui): r3-l2 report credential-only save failures
Josué04e7f74d70de
diff --git a/control-ui/app/communication-channels/[name]/edit/page.tsx b/control-ui/app/communication-channels/[name]/edit/page.tsxindex 585e9ca72..e349379f3 100644--- a/control-ui/app/communication-channels/[name]/edit/page.tsx+++ b/control-ui/app/communication-channels/[name]/edit/page.tsx@@ -377,12 +377,14 @@ export default function EditCommunicationChannelPage() {setSaving(true)setSaveError('')let mutationCommitted = saveRefreshPending+ let channelSettingsSaved = falsetry {if (specDirty) {await apiSend('PUT', `/api/v1/admin/communication-channels/${encodeURIComponent(name)}`, {spec,})mutationCommitted = true+ channelSettingsSaved = truesetSavedDraft(draft)setSaveRefreshPending(true)}@@ -408,7 +410,7 @@ export default function EditCommunicationChannelPage() {setDraft(authoritativeDraft)setSavedDraft(authoritativeDraft)setSaveError(- `Channel settings were saved, but credential changes are no longer valid for: ${validatedPlan.invalidLabels.join(', ')}.`+ `${channelSettingsSaved ? 'Channel settings were saved, but ' : ''}credential changes are no longer valid for: ${validatedPlan.invalidLabels.join(', ')}.`)return}@@ -457,7 +459,7 @@ export default function EditCommunicationChannelPage() {if (failedLabels.length) {setSaveError(- `Channel settings were saved, but some credential changes failed: ${failedLabels.join(', ')}. Retry Save to apply the remaining changes.`+ `${channelSettingsSaved ? 'Channel settings were saved, but ' : ''}some credential changes failed: ${failedLabels.join(', ')}. Retry Save to apply the remaining changes.`)return}diff --git a/control-ui/components/__tests__/EditCommunicationChannelPage.test.tsx b/control-ui/components/__tests__/EditCommunicationChannelPage.test.tsxindex 460aa7ea1..a86b1e46c 100644--- a/control-ui/components/__tests__/EditCommunicationChannelPage.test.tsx+++ b/control-ui/components/__tests__/EditCommunicationChannelPage.test.tsx@@ -430,6 +430,25 @@ describe('EditCommunicationChannelPage channel credentials', () => {{ 'slack-bot-token': 'bot-token-draft' })})++ it('describes credential-only failures without claiming channel settings were saved', async () => {+ const channel = 'credential-only-failure'+ mockChannelCredentials(channel, SLACK_CHANNEL_SPEC, { keys: [] })+ vi.mocked(api.apiSend).mockRejectedValue(new Error('credential write failed'))+ await renderLoadedPage()+ fireEvent.click(screen.getByRole('radio', { name: 'Slack' }))+ fireEvent.change(screen.getByLabelText('Slack Bot User OAuth Token'), {+ target: { value: 'bot-token-draft' },+ })++ fireEvent.click(screen.getByRole('button', { name: 'Save changes' }))++ const alert = await screen.findByRole('alert')+ expect(alert).toHaveTextContent(/credential changes failed: Slack Bot User OAuth Token/i)+ expect(alert).not.toHaveTextContent(/channel settings were saved/i)+ expect(api.apiSend).toHaveBeenCalledTimes(1)+ expect(navigation.push).not.toHaveBeenCalled()+ })})/** Both strings are written out rather than imported: this copy IS the feature,diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex 47ac869ec..ee59e5faf 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.645",+ "version": "0.1.646","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.645",+ "version": "0.1.646","dependencies": {"@clerum/display-field": "file:../packages/display-field","@clerum/frontend-components": "file:../packages/frontend-components",diff --git a/control-ui/package.json b/control-ui/package.jsonindex 560eb0e75..6dbe50fc7 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.645",+ "version": "0.1.646","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",