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

refactor: Omnichannel queue processing #34192

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

KevLehman
Copy link
Contributor

@KevLehman KevLehman commented Dec 16, 2024

Proposed changes (including videos or screenshots)

Refactor includes 3 aspects:

  • Changing the way we fetch the queue list to not append the public queue by default. This makes the server to not run the public queue always (as it is now) even if there was no work to be done.
  • Changes how the queue executes: previously, it was executed in a kind of chain: We fetched a list of "queues", then we took one, processed it, and after that we scheduled the next run, which could take some time. Now, every TIMEOUT, server will try to process all the queues, 1 by 1, and then schedule the next run for all queues after TIMEOUT. This should speed up chat assignment and reduce waiting time when waiting queue is enabled.
  • Removes the unlockAndRequeue and replcaes it with just unlock. This change shouldn't be noticeable. The original idea of the requeueing was to iterate over the inquiries when 1 wasn't being able to be taken. Idea was to avoid blocking the queue by rotating them instead of fetching the same until it gets routed, however this never worked cause we never modified the global sorting for the inquiries and it kept using the ts as the sorting, which returned always the oldest and ignored the requeing. So we're removing those extra steps as well.

Other smol changes:

  • The return values of the maxChats functions should always be numbers.
  • The server swallows some logs on the processing when the action is performed by the server (queue worker) and makes hard to identify which precondition failed for an agent. Logs were improved.
  • The process of the worker processing a queue is now traced.

Issue(s)

https://rocketchat.atlassian.net/browse/CORE-896

Steps to test or reproduce

Further comments

Copy link
Contributor

dionisio-bot bot commented Dec 16, 2024

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is targeting the wrong base branch. It should target 7.3.0, but it targets 7.2.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Dec 16, 2024

⚠️ No Changeset found

Latest commit: 20e7a4a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Dec 16, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-34192/
on branch gh-pages at 2024-12-17 17:46 UTC

Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.82%. Comparing base (47f24c2) to head (20e7a4a).
Report is 11 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #34192      +/-   ##
===========================================
+ Coverage    75.79%   75.82%   +0.02%     
===========================================
  Files          511      511              
  Lines        22132    22166      +34     
  Branches      5394     5396       +2     
===========================================
+ Hits         16775    16807      +32     
- Misses        4709     4711       +2     
  Partials       648      648              
Flag Coverage Δ
unit 75.82% <100.00%> (+0.02%) ⬆️

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

@KevLehman KevLehman added this to the 7.2.0 milestone Dec 17, 2024
@KevLehman KevLehman marked this pull request as ready for review December 17, 2024 18:39
@KevLehman KevLehman requested review from a team as code owners December 17, 2024 18:39
@MarcosSpessatto MarcosSpessatto modified the milestones: 7.2.0, 7.3.0 Dec 19, 2024
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.

4 participants