Skip to content

fix: Betterbugs cyclic dependency by refactoring metadata into HelpButton and HomepageHeade…#41557

Open
sebastianiv21 wants to merge 1 commit intoreleasefrom
fix/betterbugs-cyclic-dependecy
Open

fix: Betterbugs cyclic dependency by refactoring metadata into HelpButton and HomepageHeade…#41557
sebastianiv21 wants to merge 1 commit intoreleasefrom
fix/betterbugs-cyclic-dependecy

Conversation

@sebastianiv21
Copy link
Contributor

@sebastianiv21 sebastianiv21 commented Feb 13, 2026

…rAction

  • Added useBetterbugsMetadata hook to retrieve Betterbugs-related metadata.
  • Updated HelpButton and HomepageHeaderAction components to utilize the new metadata when invoking the Betterbugs SDK, enhancing the context provided during bug reporting.
  • Refactored BetterbugsUtil to accept metadata parameters for improved functionality and data accuracy.

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.

Fixes #Issue Number
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/22006715339
Commit: 3c98b61
Cypress dashboard.
Tags: @tag.All
Spec:


Sat, 14 Feb 2026 01:06:32 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

Release Notes

  • Refactor
    • Improved bug reporting metadata handling to ensure more accurate context is captured when submitting bug reports. The system now explicitly passes session and application metadata to the bug reporting utility, replacing reliance on implicit global state.

…rAction

- Added `useBetterbugsMetadata` hook to retrieve Betterbugs-related metadata.
- Updated `HelpButton` and `HomepageHeaderAction` components to utilize the new metadata when invoking the Betterbugs SDK, enhancing the context provided during bug reporting.
- Refactored `BetterbugsUtil` to accept metadata parameters for improved functionality and data accuracy.
@sebastianiv21 sebastianiv21 added Bug Something isn't working ok-to-test Required label for CI labels Feb 13, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Walkthrough

This pull request refactors the Betterbugs integration to use explicit metadata plumbing via a new Redux-backed hook instead of relying on store selectors within utility functions. The useBetterbugsMetadata hook collects instance, tenant, application, and page IDs, which are then passed to Betterbugs utility methods in two UI components.

Changes

Cohort / File(s) Summary
UI Component Hook Integration
app/client/src/pages/Editor/HelpButton.tsx, app/client/src/pages/common/SearchBar/HomepageHeaderAction.tsx
Added useBetterbugsMetadata hook invocation and pass collected metadata to BetterbugsUtil.show() calls.
Metadata Hook
app/client/src/utils/hooks/useBetterbugsMetadata.ts
New React hook that selects and returns instanceId, tenantId, applicationId, and pageId from Redux store as a BetterbugsMetadata object.
Betterbugs Utility Refactoring
app/client/src/utils/Analytics/betterbugs.ts
Introduced BetterbugsMetadata interface; refactored init, show, and updateMetadata to accept optional metadata parameter; removed store dependency in favor of explicit metadata plumbing; updated internal param construction and runtime metadata gathering to consume passed metadata.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

📦 Metadata flows with purpose clear,
From Redux store to handlers near,
No hidden state, just plumbing done,
Dependencies wired, one by one! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning PR description is incomplete. Missing issue reference, motivation/context, dependencies list, and relevant documentation links required by template. Add issue number/URL (required), provide clear motivation and context for the Betterbugs metadata integration, list any dependencies, and include relevant documentation links.
✅ Passed checks (2 passed)
Check name Status Explanation
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into release
Title check ✅ Passed The title clearly and concisely summarizes the main change: refactoring Betterbugs metadata handling to resolve cyclic dependencies.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/betterbugs-cyclic-dependecy

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added Enhancement New feature or request and removed Bug Something isn't working labels Feb 13, 2026
@sebastianiv21 sebastianiv21 changed the title feat: integrate Betterbugs metadata into HelpButton and HomepageHeade… fix: Betterbugs cyclic dependency by refactoring metadata into HelpButton and HomepageHeade… Feb 13, 2026
@github-actions github-actions bot added Bug Something isn't working and removed Enhancement New feature or request labels Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working ok-to-test Required label for CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant