-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
chore: dup of #28720 for tests #29436
Conversation
|
Codecov Report
@@ Coverage Diff @@
## develop #29436 +/- ##
===========================================
+ Coverage 45.76% 46.72% +0.96%
===========================================
Files 685 698 +13
Lines 12984 13100 +116
Branches 2208 2233 +25
===========================================
+ Hits 5942 6121 +179
+ Misses 6732 6663 -69
- Partials 310 316 +6
Flags with carried forward coverage won't be shown. Click here to find out more. |
return LivechatRooms.findOneById(rid); | ||
const newRoom = await LivechatRooms.findOneById(rid); | ||
if (!newRoom) { | ||
logger.debug(`Room with id ${rid} not found`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be a logger.error
since it is being throw
?
const newRoom = await LivechatRooms.findOneById(rid); | ||
if (!newRoom) { | ||
logger.debug(`Room with id ${rid} not found`); | ||
throw new Error('room-not-found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens to this error thrown? is it caught somewhere?
const agentObj = agentId && (await findAgent(agentId)); | ||
if (agentObj) { | ||
if (isAgentWithInfo(agentObj)) { | ||
const { username = undefined } = agentObj; | ||
agent = { agentId, username }; | ||
agent = { agentId, username } as SelectedAgent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this type cast looks wrong.. username
cannot be undefined
in SelectedAgent
..
} else { | ||
agent = { agentId }; | ||
agent = { agentId } as SelectedAgent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks wrong as well, since username
is mandatory on SelectedAgent
.. maybe SelectedAgent
needs to be modified to allow both use cases on this file, and then the type cast can be removed.
Hey @sampaiodiego , this PR should be in draft, but pls move your comments to #28720 as this is supposed to be the same PR (not completely sure why this extra PR was needed tho, as we only do these for community) |
I'm confused 😞 |
Sorry about the confusion guys. I was struggling with trying to reproduce an issue that which QA team was facing in the QA environment. That issue was not reproducible anywhere else locally except for that QA env. Hence we thought that something must be going wrong on that QA env due to which we decided to spin up yet another QA env for testing this PR. Hence I created this new PR to spin up a brand new QA env. |
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments