Skip to content

Conversation

@chakra-guy
Copy link
Collaborator

@chakra-guy chakra-guy commented May 8, 2025

This PR addresses a bug in the analytics sender logic and improves design by switching from interval-based to timeout-based scheduling. Additionally, tests now use fake timers for faster execution.

Changes

  • Bug Fix: Fixed an issue where the sender would not send events properly under certain conditions.
  • Timeout-Based Logic: Replaced interval-based scheduling with timeout-based logic in Sender.
  • Fake Timers in Tests: Updated sender.test.ts to use fake timers, significantly speeding up test execution.
  • Test Updates: Adjusted test cases to align with the new timeout-based logic and improved test reliability.

References

  • No specific issues tied to this PR.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@chakra-guy chakra-guy marked this pull request as ready for review May 8, 2025 11:28
@chakra-guy chakra-guy requested a review from a team as a code owner May 8, 2025 11:28
@chakra-guy chakra-guy changed the title refactor analytics Refactor sdk-analytics May 8, 2025
@codecov
Copy link

codecov bot commented May 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.05%. Comparing base (02f55b4) to head (f0b8f6e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1288   +/-   ##
=======================================
  Coverage   74.05%   74.05%           
=======================================
  Files         182      182           
  Lines        4352     4352           
  Branches     1066     1066           
=======================================
  Hits         3223     3223           
  Misses       1129     1129           

☔ 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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 8, 2025

Copy link
Contributor

@elribonazo elribonazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@chakra-guy chakra-guy merged commit 1f09a7b into main May 9, 2025
37 checks passed
@chakra-guy chakra-guy deleted the refactor-sdk-analytics branch May 9, 2025 10:09
@chakra-guy chakra-guy mentioned this pull request May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants