-
Notifications
You must be signed in to change notification settings - Fork 415
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
fix(webhook/logging): log response code only if response is not none #3354
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3354 +/- ##
===========================================
- Coverage 95.96% 18.00% -77.96%
===========================================
Files 1071 990 -81
Lines 32743 28561 -4182
===========================================
- Hits 31421 5143 -26278
- Misses 1322 23418 +22096 ☔ View full report in Codecov by Sentry. |
Uffizzi Preview |
@@ -22,9 +22,10 @@ def __init__(self, config: WebhookConfiguration): | |||
|
|||
def _identify_user(self, data: typing.Mapping) -> None: | |||
response = call_integration_webhook(self.config, data) |
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.
Under what circumstances does call_integration_webhook
return None
?
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.
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.
Ah ok, interesting. This solution seems fine for now I guess, but perhaps my original solution was wrong, and we should just try/except the call_integration_webhook
function 🤔
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingdocs/
if required so people know about the feature!Changes
Handle
call_integration_webhook
returningNone
in case of failuredetails: https://flagsmith.sentry.io/issues/4874822372/?project=5544478&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=24h&stream_index=0
How did you test this code?
I have tested it manually but writing a test for this will involve unit testing a private method. Keen to get some input on this