-
Notifications
You must be signed in to change notification settings - Fork 6
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: SDK analytics #545
fix: SDK analytics #545
Conversation
d80298c
to
be38431
Compare
|
||
request_auth | ||
.validate() | ||
.map_err(RelayMessageServerError::NotifyServer)?; // TODO change to client error? |
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.
Can you elaborate on why it should be a client error?
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 have a bunch of these TODOs throughout the codebase, basically means "you should re-evaluate if you can do it better". Started when I started refactoring stuff to be capable of sending errors to clients but there are still a number of places remaining.
In this case, it should be a client error because the request failed validation.
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.
Saw the sends via the channel fed to handle
, didn't strike me as too weird but I may lack context.
FWIW in the Go programming language you'd normally spawn goroutines (tokio tasks) and expect them to send back data via channels so this concurrency setup is not entirely foreign
This reverts commit afad3cc.
Description
Adds SDK version analytics as per the spec.
This adds a oneshot channel to transmit this information to outside of the
handle()
function which is a little strange, but seemed like a good enough solution considering the desire to have this info for bothOk
andErr
cases and it would be more verbose to make returningsdk
in both cases compatible with?
.This also moves the validation of the JWT payloads further up in the request processing.
Resolves #475
How Has This Been Tested?
Not tested
Due Diligence