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

fix: SDK analytics #545

Merged
merged 4 commits into from
May 8, 2024
Merged

fix: SDK analytics #545

merged 4 commits into from
May 8, 2024

Conversation

chris13524
Copy link
Member

@chris13524 chris13524 commented May 7, 2024

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 both Ok and Err cases and it would be more verbose to make returning sdk 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

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update


request_auth
.validate()
.map_err(RelayMessageServerError::NotifyServer)?; // TODO change to client error?

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?

Copy link
Member Author

@chris13524 chris13524 May 8, 2024

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.

Copy link

@nopestack nopestack left a 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

@chris13524 chris13524 merged commit afad3cc into main May 8, 2024
17 checks passed
@chris13524 chris13524 deleted the fix/sdk-analytics branch May 8, 2024 11:33
chris13524 added a commit that referenced this pull request May 8, 2024
chris13524 added a commit that referenced this pull request May 8, 2024
chris13524 added a commit that referenced this pull request May 8, 2024
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.

feat: SDK version analytics
2 participants