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: GetUser returning wrong users for alias #89

Merged
merged 4 commits into from
Jun 25, 2021

Conversation

bancey
Copy link
Contributor

@bancey bancey commented Jun 24, 2021

Purpose

Bug introduced in #88 where the GetUser logic would ignore the given alias and attempt to return the currentUser

Approach

Includes checks against the alias also removed ThreadLocal in favour of ThreadStatic

The default behaviour wasn't returning a user for the given alias when `currentUser` was `true`. It would also cycle users when requesting the same alias in a single scenario with `currentUser` was set to `true` if the calls were separated by a call for another alias.
Depending on the test runner, this code would fail. Synchronisation also needs to happen across processes in the case where build agents are running multiple test runs concurrently.
@ewingjm ewingjm changed the title fix: issue where GetUser logic ignored the given alias fix: GetUser returning wrong users for alias Jun 25, 2021
@sonarcloud
Copy link

sonarcloud bot commented Jun 25, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

94.1% 94.1% Coverage
0.0% 0.0% Duplication

@ewingjm ewingjm merged commit 2f7a932 into master Jun 25, 2021
@ewingjm ewingjm deleted the fix/current-user-ignores-alias branch June 25, 2021 12:53
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.

2 participants