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

feat: user and session ids #163

Merged
merged 4 commits into from
Nov 22, 2022

Conversation

tdashworth
Copy link
Contributor

Resolves #156.

@IvanJosipovic
Copy link
Owner

Hey, thanks for this PR, do you mind also trying to write up some tests for this?

We need to make sure these calls don't throw exceptions if the app insight js is blocked etc.

@tdashworth
Copy link
Contributor Author

They don't make calls from what I can tell.

I could assert the userId against the hardcoded one?

@IvanJosipovic
Copy link
Owner

They don't make calls from what I can tell.

I could assert the userId against the hardcoded one?

We have a command to set the User ID, https://github.com/IvanJosipovic/BlazorApplicationInsights/blob/2f2a40e101e4d00fd860dbe483d8d3a6bff74871/src/BlazorApplicationInsights/IApplicationInsights.cs#LL140C14-L140C41

For the UserId we could do something like this:

  • The sample has a button which runs "SetAuthenticatedUserContext"
  • Create another button which runs GetUserId and sets the value on the page
  • The test should trigger the two buttons and read the value from the page

@tdashworth
Copy link
Contributor Author

@IvanJosipovic tests added 😄

@IvanJosipovic IvanJosipovic merged commit a0e78fa into IvanJosipovic:master Nov 22, 2022
@github-actions
Copy link

🎉 This PR is included in version 2.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Get User and Session IDs
2 participants