feat: prompt users to enable Insights on first MCP server enable#1660
feat: prompt users to enable Insights on first MCP server enable#1660simplesagar wants to merge 4 commits intomainfrom
Conversation
When a user enables their first MCP server, the ServerEnableDialog now shows an "Enable Insights" toggle (defaulting to ON) that opts the org into log capture. This helps users discover observability features earlier rather than finding the prompt only when visiting the Logs page. Closes AGE-1383 https://speakeasyapi.slack.com/archives/C08H55TP4HZ/p1771605667549619?thread_ts=1771605435.984869&cid=C08H55TP4HZ https://claude.ai/code/session_01XPgEFhNdNSfSV4YQ7qGHDk
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 563ec9c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🚀 Preview Environment (PR #1660)Preview URL: https://pr-1660.dev.getgram.ai
Gram Preview Bot |
| if (isFirstServerEnable && enableInsights) { | ||
| setLogsFeature({ | ||
| request: { | ||
| setProductFeatureRequestBody: { | ||
| featureName: FeatureName.Logs, | ||
| enabled: true, | ||
| }, | ||
| }, | ||
| }); | ||
| } | ||
| onConfirm(); | ||
| onClose(); |
There was a problem hiding this comment.
🟡 setLogsFeature mutation fires without error handling, silently failing
The setLogsFeature mutation at server-enable-dialog.tsx:38-45 is called in a fire-and-forget manner with no onError or onSuccess callbacks. If the mutation fails (e.g., network error, permission issue), the user receives no feedback and believes Insights was enabled when it wasn't.
Comparison with existing pattern and impact
The existing EnableLoggingOverlay component at client/dashboard/src/components/EnableLoggingOverlay.tsx:16-27 properly handles both success and error states for the same useFeaturesSetMutation:
const { mutate: setLogsFeature, status: mutationStatus } =
useFeaturesSetMutation({
onSuccess: () => {
setMutationError(null);
onEnabled();
},
onError: (err) => {
const message =
err instanceof Error ? err.message : "Failed to enable logging";
setMutationError(message);
},
});In the new code, onConfirm() and onClose() are called immediately after setLogsFeature() at lines 47-48, regardless of whether the mutation succeeds. The dialog closes and the server enable proceeds, but if the logs feature mutation fails, the user has no way to know. They would only discover the issue later when visiting the Logs/Insights page and finding it disabled.
Was this helpful? React with 👍 or 👎 to provide feedback.
Address Devin review feedback - the enableInsights state was persisting across dialog open/close cycles. If a user toggled it OFF and cancelled, reopening would show OFF instead of resetting to the default ON state. Added useEffect to reset the toggle to true whenever isOpen becomes true. https://claude.ai/code/session_01XPgEFhNdNSfSV4YQ7qGHDk
The catalog path bypasses ServerEnableDialog since it creates MCP servers already enabled. Add the Insights toggle to AddServerDialog and AddServersDialog so users on the catalog path also get prompted to enable logs on their first server add. https://claude.ai/code/session_01XPgEFhNdNSfSV4YQ7qGHDk
When a user enables their first MCP server, the ServerEnableDialog now shows an "Enable Insights" toggle (defaulting to ON) that opts the org into log capture. This helps users discover observability features earlier rather than finding the prompt only when visiting the Logs page.
Closes AGE-1383
https://speakeasyapi.slack.com/archives/C08H55TP4HZ/p1771605667549619?thread_ts=1771605435.984869&cid=C08H55TP4HZ https://claude.ai/code/session_01XPgEFhNdNSfSV4YQ7qGHDk