-
Notifications
You must be signed in to change notification settings - Fork 2
sdk-core, node: attribute validation #296
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
Conversation
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.
Something is wrong with our node tests. I think we expect the app to fail when there is no application version or application in the attributes.
@@ -418,4 +420,51 @@ export abstract class BacktraceCoreClient< | |||
private static destroy() { | |||
this._instance = undefined; | |||
} | |||
|
|||
private validateAttributes() { | |||
function isNotEmptyString(v: unknown) { |
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.
we're introducing a nice way to validate attributes, but in our scenario, we don't need such complexity. What we can do is just simply test if those two attributes are defined. Based on what we want to verify and how easily we can achieve that, wouldn't it be better if we keep the smallest/simplest solution for now?
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.
how would you do this more "easily"?
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 simply
const attributes = this.attributeManager.ger()
const validAttributes = !!attributes["application"] && !!attributes["application.version"]
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.
simplified a bit
6a5b22b
to
81a438f
Compare
This PR adds attribute validation on initialize, which checks the following attributes:
application
application.version
This also removes the check from
node
.