Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Creation Quote Metric #55
Creation Quote Metric #55
Changes from 12 commits
2e49f30
29b5577
d1ab98e
fc479f8
3d8e132
4631ec3
17de4e2
c4667b2
8b39751
299b5e7
0d2b784
fc5dc22
2f5558d
b5201e2
9928cf8
f1b4c40
6a64cf5
dd75260
4f5771e
6e8e773
65b826c
bd5734c
5392102
bf68d1c
4bff5c2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Just a small indentation fix:
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.
When a GraphQL request fails, the response status is often 200 anyway, depending on the type of the error (mainly because there can be partial errors). So there would be no exception thrown here, but
data
might be undefined, or it might only have part of the information you requested. In those cases the response will contain a field callederrors
, so you can check for that here.More information on graphql errors here.
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.
You're using an optional operator here, so you're assuming that
data.getUserByEmail
might not be set, right? If that's a possibility then you shouldn't cast to string here, as it'll makecostId
's type not consider the use case where it will beundefined
. Is it ok ifcostId
isn't set? If it isn't it's better to bail early here, and if it's ok then you should let it bestring | undefined
.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.
In line 98 the code is assuming that
namespaces.profile.email.value
is always set, but here you're handling the case wherenamespaces
andprofile
might not be set. If that's a possibility we need to also add this to lines 97 and 98, skipping the whole metric process in case the values are not set (since those are required).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.
Instead of skipping the while metric process, I'll check the namespace, profile, and email, and let it save null values. I believe it's better to save the metric with the data we have than not save it at all
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.
I agree, if the metric is still useful, let's save it!