Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Livechat analytics in a given date range consider conversation data from the following day #33054

Merged
merged 14 commits into from
Aug 22, 2024

Conversation

matheusbsilva137
Copy link
Member

@matheusbsilva137 matheusbsilva137 commented Aug 14, 2024

Proposed changes (including videos or screenshots)

  • Fixed livechat analytics/metrics that were considering one extra day beyond of the provided date range. Affected metrics are:
    • All overview productivity metrics (livechat/analytics/overview endpoint): average of response time, average of first response time, average of reaction time (among all agents);
    • All conversations metrics for agents (livechat/analytics/agent-overview endpoint): total conversations (percentage of taken conversations), average chat duration and total messages;
    • All productivity metrics for agents (livechat/analytics/agent-overview endpoint): average first response time, best first response time, average response time and average reaction time (for each specific agent).

Charts metrics and conversation overview metrics should not be affected by this change (since this specific issue was not happening to them)

Issue(s)

Steps to test or reproduce

Go to Omnichannel > Analytics and select a date range in which there is not livechat activity in the workspace, but there is activity in the following day.
Current behavior: the analytics listed above would be affected by the data from conversation from the following day (ie the day after the selected period end date).
Expected behavior: only conversations in the selected date range should be considered to build all livechat analytics.

Further comments

CORE-610

Copy link
Contributor

dionisio-bot bot commented Aug 14, 2024

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Aug 14, 2024

🦋 Changeset detected

Latest commit: 09a686c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 32 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/model-typings Patch
@rocket.chat/apps Patch
@rocket.chat/models Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/omnichannel-services Patch
rocketchat-services Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/instance-status Patch
@rocket.chat/presence Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/api-client Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/web-ui-registration Patch

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

Copy link

codecov bot commented Aug 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.38%. Comparing base (be5d153) to head (09a686c).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #33054   +/-   ##
========================================
  Coverage    59.38%   59.38%           
========================================
  Files         2547     2547           
  Lines        63241    63238    -3     
  Branches     14225    14224    -1     
========================================
- Hits         37558    37557    -1     
+ Misses       22975    22974    -1     
+ Partials      2708     2707    -1     
Flag Coverage Δ
unit 75.84% <ø> (ø)

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

@matheusbsilva137 matheusbsilva137 added this to the 6.12 milestone Aug 14, 2024
@matheusbsilva137 matheusbsilva137 marked this pull request as ready for review August 14, 2024 20:01
@matheusbsilva137 matheusbsilva137 requested review from a team as code owners August 14, 2024 20:01
Copy link
Member

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

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

Would it be possible and also does it make sense to add some test cases to cover (also) cases where there is some data for that specific day and we can ensure that is calculating it properly?

Just to have more cases, not ONLY with 0 conversations.

@matheusbsilva137
Copy link
Member Author

Would it be possible and also does it make sense to add some test cases to cover (also) cases where there is some data for that specific day and we can ensure that is calculating it properly?

Just to have more cases, not ONLY with 0 conversations.

We can't do that on the end-to-end tests since we only have data for the "current day" there
But that's something we could validate in the unit tests. I'll add some new unit test cases for overview metrics

KevLehman
KevLehman previously approved these changes Aug 16, 2024
@dionisio-bot dionisio-bot bot added stat: ready to merge PR tested and approved waiting for merge stat: QA assured Means it has been tested and approved by a company insider and removed stat: QA tested labels Aug 20, 2024
@kodiakhq kodiakhq bot removed the stat: ready to merge PR tested and approved waiting for merge label Aug 20, 2024
Copy link
Contributor

kodiakhq bot commented Aug 20, 2024

This PR currently has a merge conflict. Please resolve this and then re-add the ['stat: ready to merge', 'automerge'] label.

@matheusbsilva137 matheusbsilva137 added the stat: ready to merge PR tested and approved waiting for merge label Aug 22, 2024
@kodiakhq kodiakhq bot merged commit a14c067 into develop Aug 22, 2024
49 checks passed
@kodiakhq kodiakhq bot deleted the fix/livechat-analytics-time-range branch August 22, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
squad: core stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants