Skip to content

feat(amplitude): integrate AmplitudeProvider and refactor initialization logic#35415

Merged
iamjoel merged 1 commit intomainfrom
feat/amp-init
Apr 20, 2026
Merged

feat(amplitude): integrate AmplitudeProvider and refactor initialization logic#35415
iamjoel merged 1 commit intomainfrom
feat/amp-init

Conversation

@CodingOnStar
Copy link
Copy Markdown
Contributor

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

  • Added AmplitudeProvider to the main layout for analytics tracking.
  • Removed redundant AmplitudeProvider instances from common layouts.
  • Introduced a new init module to handle Amplitude initialization and session replay plugin setup.
  • Updated tests to ensure proper initialization behavior and prevent multiple initializations.

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@CodingOnStar CodingOnStar requested a review from lyzno1 April 20, 2026 05:47
@github-actions github-actions Bot added the web This relates to changes on the web. label Apr 20, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.50%. Comparing base (8f070f2) to head (b6a0062).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
web/app/components/base/amplitude/init.ts 92.59% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #35415      +/-   ##
==========================================
- Coverage   85.50%   85.50%   -0.01%     
==========================================
  Files        4433     4434       +1     
  Lines      206943   206953      +10     
  Branches    38519    38521       +2     
==========================================
+ Hits       176940   176948       +8     
- Misses      26899    26901       +2     
  Partials     3104     3104              
Flag Coverage Δ
dify-ui 92.85% <ø> (ø)
web 86.34% <92.85%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…ion logic

- Added AmplitudeProvider to the main layout for analytics tracking.
- Removed redundant AmplitudeProvider instances from common layouts.
- Introduced a new init module to handle Amplitude initialization and session replay plugin setup.
- Updated tests to ensure proper initialization behavior and prevent multiple initializations.
@CodingOnStar CodingOnStar marked this pull request as ready for review April 20, 2026 06:52
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. javascript Pull requests that update javascript code labels Apr 20, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 20, 2026
@iamjoel iamjoel added this pull request to the merge queue Apr 20, 2026
Merged via the queue into main with commit 1a7e463 Apr 20, 2026
34 checks passed
@iamjoel iamjoel deleted the feat/amp-init branch April 20, 2026 07:35
HanqingZ pushed a commit to HanqingZ/dify that referenced this pull request Apr 23, 2026
…ion logic (langgenius#35415)

Co-authored-by: CodingOnStar <hanxujiang@dify.com>
asukaminato0721 pushed a commit to asukaminato0721/dify that referenced this pull request Apr 24, 2026
…ion logic (langgenius#35415)

Co-authored-by: CodingOnStar <hanxujiang@dify.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants