Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

fix/telemetry(auth): return authenticated context from session.SetActorFromUser#62701

Merged
bobheadxi merged 2 commits into
mainfrom
bugfix-session-store
May 15, 2024
Merged

fix/telemetry(auth): return authenticated context from session.SetActorFromUser#62701
bobheadxi merged 2 commits into
mainfrom
bugfix-session-store

Conversation

@bobheadxi

Copy link
Copy Markdown
Member

This change fixes telemetry for various sign-in, sign-up telemetry events - session.SetActorFromUser accepts a context and returns a new one, but never does anything to the returned context. It makes sense for this to authenticate the context because it is only ever used on a success case, and in turn this fixes telemetry by providing the telemetry SDK an actor to extract a user ID for.

For the events affected by session.SetActorFromUser I've incremented the event version to 2.

Test plan

  1. Test on sign-in-success that a event with the user is recorded
  2. Test on session.SetActorFromUser to verify context is authenticated

@bobheadxi bobheadxi requested review from a team and akalia25 May 15, 2024 18:38
@cla-bot cla-bot Bot added the cla-signed label May 15, 2024
FeatureExample eventFeature = "exampleFeature"

// FeatureSignIn, FeatureSignOut, and FeatureSignUp are added here as telemetry
// examples - most callsites can directly provide the relevant feature.
FeatureSignIn eventFeature = "signIn"
FeatureSignOut eventFeature = "signOut"
FeatureSignUp eventFeature = "signUp"
)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was back before I realised it was kind of dumb to define event features all in one place, we now define features directly at callsite. This should be a no-op change.

@akalia25 akalia25 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the quick fix!

@bobheadxi bobheadxi force-pushed the bugfix-session-store branch from 21a6020 to 32cf76f Compare May 15, 2024 19:40
@bobheadxi bobheadxi merged commit 8887505 into main May 15, 2024
@bobheadxi bobheadxi deleted the bugfix-session-store branch May 15, 2024 23:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants