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

Change Koa openSegment middleware declaration return type to match expected Koa.Middleware type #525

Merged
merged 2 commits into from
Aug 8, 2022

Conversation

carolabadeer
Copy link
Contributor

Issue #, if available: This PR fixes issue #522

Description of changes:
The issue above mentions a type error that occurs when using the opensegment middleware in koa and typescript due to a mismatch between the expected return type, Koa.Middleware, and the type declared for the opensegment middleware, Function.

The type declaration is updated below to fix this issue and avoid this manual workaround:

app.use(XRayKoa.openSegment("test") as Koa.Middlware);

and allow for consistency in using this middleware in JS & TS.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@carolabadeer carolabadeer requested a review from a team as a code owner August 8, 2022 21:48
@codecov-commenter
Copy link

codecov-commenter commented Aug 8, 2022

Codecov Report

Merging #525 (fc36d3b) into master (d2abfd3) will not change coverage.
The diff coverage is n/a.

❗ Current head fc36d3b differs from pull request most recent head cca16ef. Consider uploading reports for the commit cca16ef to get more accurate results

@@           Coverage Diff           @@
##           master     #525   +/-   ##
=======================================
  Coverage   82.34%   82.34%           
=======================================
  Files          36       36           
  Lines        1756     1756           
=======================================
  Hits         1446     1446           
  Misses        310      310           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@willarmiros willarmiros left a comment

Choose a reason for hiding this comment

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

lgtm

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.

None yet

3 participants