Skip to content

refactor: Omnichannel queue processing#34192

Merged
kodiakhq[bot] merged 7 commits intodevelopfrom
fix/queue-queueing
Jan 20, 2025
Merged

refactor: Omnichannel queue processing#34192
kodiakhq[bot] merged 7 commits intodevelopfrom
fix/queue-queueing

Conversation

@KevLehman
Copy link
Member

@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

@dionisio-bot
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 targeting the wrong base branch. It should target 7.4.0, but it targets 7.3.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Dec 16, 2024

⚠️ No Changeset found

Latest commit: 6a1db54

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 16, 2024

PR Preview Action v1.6.0

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-34192/

Built to branch gh-pages at 2025-01-20 17:09 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.00%. Comparing base (d949016) to head (6a1db54).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##           develop   #34192       +/-   ##
============================================
+ Coverage    59.18%   75.00%   +15.82%     
============================================
  Files         2822      517     -2305     
  Lines        68144    22756    -45388     
  Branches     15156     5522     -9634     
============================================
- Hits         40333    17069    -23264     
+ Misses       24979     5024    -19955     
+ Partials      2832      663     -2169     
Flag Coverage Δ
e2e ?
e2e-api ?
unit 75.00% <100.00%> (-0.01%) ⬇️

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
tapiarafael
tapiarafael previously approved these changes Dec 17, 2024
@MarcosSpessatto MarcosSpessatto modified the milestones: 7.2.0, 7.3.0 Dec 19, 2024
@jessicaschelly jessicaschelly added the stat: QA assured Means it has been tested and approved by a company insider label Jan 17, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jan 17, 2025
@scuciatto scuciatto removed this from the 7.3.0 milestone Jan 20, 2025
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Jan 20, 2025
@scuciatto scuciatto added this to the 7.4.0 milestone Jan 20, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jan 20, 2025
@kodiakhq kodiakhq bot merged commit c9a5c78 into develop Jan 20, 2025
48 checks passed
@kodiakhq kodiakhq bot deleted the fix/queue-queueing branch January 20, 2025 18:32
@KevLehman
Copy link
Member Author

/patch

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Feb 4, 2025

Pull request #35112 added to Project: "Patch 7.3.1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

7 participants