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

port: [#4062] Log BadRequest in adapter (#6135) #265

Closed
wants to merge 5 commits into from

Conversation

mraitersw
Copy link

@mraitersw mraitersw commented Mar 10, 2022

Fixes # 4062
#minor

Description

Add warn logger when the activity hasn't a type.

Specific Changes

  • Added in the common function, between botFrameworkAdapter and cloudAdapater, that validate the actity type.

Tests

image

@mraitersw mraitersw changed the title port [#4062]: Log BadRequest in adapter (#6135) port: [#4062] Log BadRequest in adapter (#6135) Mar 10, 2022
@coveralls
Copy link

coveralls commented Mar 10, 2022

Pull Request Test Coverage Report for Build 1968954497

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.3%) to 84.544%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/botbuilder/src/cloudAdapter.ts 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
libraries/botbuilder/src/cloudAdapter.ts 1 32.54%
Totals Coverage Status
Change from base Build 1958146671: 0.3%
Covered Lines: 19669
Relevant Lines: 22038

💛 - Coveralls

Copy link

@ceciliaavila ceciliaavila left a comment

Choose a reason for hiding this comment

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

I think this should be in cloudAdapter.ts, line 130.
Here we are already throwing a descriptive error.

Comment on lines 1198 to 1203
if (!req.body.type) {
console.warn('BadRequest: Missing activity or activity type.');
status = StatusCodes.BAD_REQUEST;
return;
}

Choose a reason for hiding this comment

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

I'm not sure of adding this here. In case of an error in parseRequest, would this code be reached?

Copy link
Author

Choose a reason for hiding this comment

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

but if i am adding this in the parserequest, how i will set bad request as a status?

@FedericoBernal FedericoBernal self-requested a review March 11, 2022 15:24
@ceciliaavila
Copy link

Promoted to MS in PR# 4155

@ceciliaavila ceciliaavila deleted the southworks/port/add-logger-to-bad-request branch March 11, 2022 18:13
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