Conversation
WalkthroughAdds Betterbugs frontend integration: dependency, build/env wiring, config types, a Betterbugs SDK wrapper (BetterbugsUtil), UI menu triggers to open the widget, route-change metadata updates, and nginx/jest substitutions. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant UI as "Help / Homepage Menu"
participant Config as "App Configs"
participant Util as "BetterbugsUtil"
participant SDK as "@betterbugs/web-sdk"
participant Router as "RouteChangeListener"
User->>UI: Click "Send support info"
UI->>Config: read betterbugs.enabled, apiKey
UI->>Util: show(user)
Util->>Util: destroy existing instance (if any)
Util->>Config: read apiKey, appVersion, tenantId, runtime metadata
Util->>SDK: dynamic import (browser)
SDK-->>Util: module loaded
Util->>SDK: create widget with user, metadata, styles
SDK-->>Util: instance created
Util->>SDK: openWidget()
SDK-->>User: Widget displayed
Note over Router,Util: On route change
Router->>Util: updateMetadata()
Util->>SDK: setMetadata(updatedRuntimeMetadata)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@app/client/src/pages/common/SearchBar/HomepageHeaderAction.tsx`:
- Around line 146-153: Only render the "Send support info" MenuItem when
Betterbugs is enabled and has a valid API key, and localize its label via
createMessage; update the JSX in HomepageHeaderAction to conditionally include
the <MenuItem> that calls BetterbugsUtil.show(user) by checking the Betterbugs
config flag or API key presence (use whatever config accessor exists in this
component), and replace the hardcoded text with createMessage({ id: '...',
defaultMessage: 'Send support info' }) to match other menu items.
In `@app/client/src/pages/Editor/HelpButton.tsx`:
- Line 42: The menu item for "Send support info" is added and the BetterBugs SDK
is invoked unconditionally; update the HelpButton component to only render the
menu item when the feature flag is enabled (check the app config or
betterbugs.enabled) and guard the click handler to no-op if Betterbugs isn't
configured. Concretely: in HelpButton (where the menu is built / renderMenu or
addMenuItem is called) wrap the menu-item creation in a conditional that checks
betterbugs.enabled (or call a helper like BetterbugsUtil.isEnabled()), and in
the sendSupportInfo / onSendSupportInfo handler call BetterbugsUtil only after
verifying BetterbugsUtil.isEnabled() or API key presence; if not enabled, return
early (and optionally log a debug message) so the SDK is never triggered when no
API key is configured.
|
@sebastianiv21 , we need to have an option to allow the user to disable betterbugs. This is in scenarios where its airgapped, or the user has hosted in an isolated environment and does not want to outgoing traffic to betterbugs. |
| ); | ||
|
|
||
| const betterbugs = getConfig( | ||
| ENV_CONFIG.betterbugs.apiKey, |
There was a problem hiding this comment.
Should have a way to control this from env configuration, so that it can be disabled.
Or test and see what happens if we set it up an environment that does not have outgoing access. Would it keep throwing errors.
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/21598576654. |
|
Deploy-Preview-URL: https://ce-41532.dp.appsmith.com |
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/21679221046. |
|
Deploy-Preview-URL: https://ce-41532.dp.appsmith.com |
… for disabling betterbugs
…e and update workflows
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/21716034843. |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/deploy_preview.sh (1)
117-126:⚠️ Potential issue | 🟡 MinorConsider conditional injection for all optional API keys, not just Betterbugs.
Empty values are currently passed unconditionally to Helm for all optional API keys (OPENAI_API_KEY, APPSMITH_CARBON_API_KEY, APPSMITH_BETTERBUGS_API_KEY). While the application code handles empty Betterbugs keys explicitly, applying conditional injection consistently across all optional keys would prevent unnecessary ConfigMap pollution and avoid potential SDK initialization side effects.
Either implement conditional injection for all optional API keys, or confirm the Helm chart and application layers treat empty strings as disabled across the board.
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/21718750696. |
|
Deploy-Preview-URL: https://ce-41532.dp.appsmith.com |
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/21725726438. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@app/client/src/utils/Analytics/betterbugs.ts`:
- Around line 183-195: The hide() method on the BetterBugs utility is marked
async but contains no await or asynchronous work; remove the async modifier from
the hide method declaration to avoid misleading callers and adjust any callers
only if they unnecessarily await BetterBugs.hide(); update references to the
method signature (BetterBugs.hide and this.instance.hide) accordingly so the
method is a plain synchronous function.
🧹 Nitpick comments (1)
app/client/src/utils/Analytics/betterbugs.ts (1)
145-148: RedundantupdateMetadata()call.
init()already callsgetRuntimeMetadata()and includes it in the initial metadata (line 113). CallingupdateMetadata()immediately after is redundant since the runtime state hasn't changed between these synchronous calls.♻️ Remove redundant call
// Initialize fresh instance await this.init(user); - this.updateMetadata(); - if (this.instance?.openWidget) {
| public static async hide() { | ||
| if (!this.instance) { | ||
| log.warn("BetterBugs instance not initialized."); | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| if (this.instance?.hide) { | ||
| this.instance.hide(); | ||
| } else { | ||
| log.warn("BetterBugs hide() is not available."); | ||
| } | ||
| } |
There was a problem hiding this comment.
Method marked async but performs no async operations.
hide() has no await statements, making the async keyword misleading. Callers might incorrectly assume there's an async operation to await.
🔧 Suggested fix
- public static async hide() {
+ public static hide() {
if (!this.instance) {
log.warn("BetterBugs instance not initialized.");
return;
}
- if (this.instance?.hide) {
+ if (this.instance.hide) {
this.instance.hide();
} else {
log.warn("BetterBugs hide() is not available.");
}
}🤖 Prompt for AI Agents
In `@app/client/src/utils/Analytics/betterbugs.ts` around lines 183 - 195, The
hide() method on the BetterBugs utility is marked async but contains no await or
asynchronous work; remove the async modifier from the hide method declaration to
avoid misleading callers and adjust any callers only if they unnecessarily await
BetterBugs.hide(); update references to the method signature (BetterBugs.hide
and this.instance.hide) accordingly so the method is a plain synchronous
function.
|
Deploy-Preview-URL: https://ce-41532.dp.appsmith.com |
Description
Tip
Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).
Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.
This PR integrates Betterbugs bug reporting SDK into the Appsmith client application, providing users with an enhanced bug reporting experience directly within the application interface.
Motivation and Context
Currently, users need to manually report bugs through external channels, which can be cumbersome and may result in incomplete bug reports. By integrating Betterbugs, we enable:
Fixes #
Issue Numberor
Fixes
Issue URLWarning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags=""
🔍 Cypress test results
Warning
Tests have not run on the HEAD 9a9320a yet
Thu, 05 Feb 2026 19:35:02 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Chores