Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(control-ui): state the Teams catalog wait before the click, not after the failure
Jose Ramirez8437ac90561e
diff --git a/control-ui/app/communication-channels/new/page.tsx b/control-ui/app/communication-channels/new/page.tsxindex de0f96798..0a48db1f8 100644--- a/control-ui/app/communication-channels/new/page.tsx+++ b/control-ui/app/communication-channels/new/page.tsx@@ -859,13 +859,18 @@ export default function CreateCommunicationChannelPage() {>Install in Teams</a>+ <p className="cu-teams-setup__install-note">+ Teams can take around five minutes to publish the app to its+ catalog, so the link may say the app cannot be found at first.+ That is the expected wait, not a broken setup: give it a couple of+ minutes and click it again.+ </p><details className="cu-advanced-details cu-teams-setup__fallback">- <summary>If the link says the app cannot be found</summary>+ <summary>If it still fails after several minutes</summary><p className="cu-advanced-details__hint">- The Teams app catalog has not caught up with the Developer- Portal yet. Wait a few minutes and retry the link first. If it- still fails, build the package and upload it by hand from Apps- > Manage your apps > Upload an app.+ Build the package and upload it by hand from Apps > Manage+ your apps > Upload an app. This skips the catalog lookup that+ the link depends on.</p><CommandBlockcommand={teamsPackageDownloadCommand}diff --git a/control-ui/app/globals.css b/control-ui/app/globals.cssindex 491ebe3d7..1bc0f4c0b 100644--- a/control-ui/app/globals.css+++ b/control-ui/app/globals.css@@ -9811,6 +9811,14 @@ textarea.cu-input {/* The package fallback recovers from Teams' catalog lag, which usually resolveson a retry of the link above. Collapsed, it stays available without reading asa fifth step that everyone has to perform. */+/* The catalog wait is the single most likely thing to happen right after the+ link is clicked, so it is stated before the click rather than hidden in the+ fallback below: a first-time operator who is not told to expect it reads+ "app cannot be found" as a broken setup and goes looking for the wrong bug. */+.cu-teams-setup__instructions .cu-teams-setup__install-note {+ margin: 0 0 var(--cu-space-2);+}+.cu-teams-setup__instructions .cu-teams-setup__fallback {margin-bottom: var(--cu-space-2);}diff --git a/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx b/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsxindex 47550e9a7..5ede1c6ac 100644--- a/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx+++ b/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx@@ -912,7 +912,34 @@ describe('CreateCommunicationChannelPage — Teams install link', () => {expect(disclosure).not.toBeNull()expect(disclosure).not.toHaveAttribute('open')expect(- within(disclosure as HTMLElement).getByText('If the link says the app cannot be found')+ within(disclosure as HTMLElement).getByText('If it still fails after several minutes')).toBeInTheDocument()})++ it('warns about the catalog wait up front, outside the collapsed fallback', async () => {+ vi.stubEnv('NEXT_PUBLIC_WORKFLOW_APPROVAL_READER_BASE_URL', 'https://webhook.example.com')+ render(+ <ToastProvider>+ <CreateCommunicationChannelPage />+ </ToastProvider>+ )++ await fillStep1AndContinue()+ fireEvent.click(screen.getByRole('radio', { name: 'Microsoft Teams' }))+ fireEvent.change(screen.getByLabelText(/^Name/), { target: { value: 'Evenfire Bot' } })+ fireEvent.change(screen.getByLabelText(/^CLIENT_ID/), {+ target: { value: '0cd0e1e6-adf7-40f4-952f-79006d320a05' },+ })+ fireEvent.change(screen.getByLabelText(/^TENANT_ID/), {+ target: { value: '18517e81-9d09-4c73-88f3-e84a6c90c3d9' },+ })++ // Teams publishes to its catalog on its own schedule, so the link routinely+ // 404s for the first few minutes. Stated only inside the collapsed fallback,+ // this reaches the operator AFTER they have read "app cannot be found" as a+ // broken setup and started debugging the wrong thing. It has to be visible+ // before the click, so it must not sit inside the disclosure.+ const note = screen.getByText(/five minutes to publish the app to its catalog/)+ expect(note.closest('details')).toBeNull()+ })})diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex 58e5c1398..979369aee 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.429",+ "version": "0.1.430","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.429",+ "version": "0.1.430","dependencies": {"@clerum/llm-providers": "file:../packages/llm-providers","@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",diff --git a/control-ui/package.json b/control-ui/package.jsonindex bda415e48..c97ac59cd 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.429",+ "version": "0.1.430","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",diff --git a/docs/how-to/connect-teams.md b/docs/how-to/connect-teams.mdindex 76391ff5f..48cada92b 100644--- a/docs/how-to/connect-teams.md+++ b/docs/how-to/connect-teams.md@@ -142,6 +142,13 @@ fails (see Troubleshooting), though that has not been confirmed.Open the install link, add the app, and optionally add it to a channel.+**Expect to wait about five minutes.** Teams publishes the app to its catalog on+its own schedule, and the install link fails with "This app cannot be found"+until that finishes. That is the normal wait, not a broken setup, and it is not+a reason to re-run `teams app create`, which would leave you with two bots. Give+it a couple of minutes and click the link again. Only if it still fails after+several minutes is something actually wrong: see Troubleshooting.+Then paste `CLIENT_ID`, `TENANT_ID` and `CLIENT_SECRET` into the Control UI andcreate the channel. The secret is stored as `teams-app-password` in a Secretnamed `cc-<channel-name>-credentials` in the `channels` namespace, and is@@ -289,15 +296,19 @@ signed-in user is not the one it was assigned to. Check `teams status` ratherthan guessing.**The install link says "This app cannot be found."** Clicking the-**Install in Teams** link `teams app create` prints, right after creation, can-return this even though the app exists and is visible in the Developer Portal.+**Install in Teams** link `teams app create` prints, right after creation,+returns this even though the app exists and is visible in the Developer Portal.It reads like the create failed. It did not: re-running `teams app create` inresponse leaves you with two bots.+For roughly the first five minutes this is just the catalog catching up, and the+fix is to wait and click the link again. Everything below is for a link that is+still failing after several minutes.+Two workarounds. Use **Preview in Teams** from the[Developer Portal](https://dev.teams.microsoft.com/apps) instead of the-printed link; it bypasses the catalog lookup that is failing. Or wait a short-while and regenerate the link:+printed link; it bypasses the catalog lookup that is failing. Or regenerate the+link:```shellteams app get YOUR_CLIENT_ID --install-link