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

Fixing a bug in merging token id and user info data. 0 is being omitted. #1220

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

jeff-chd-g
Copy link

This solution is created based on a bug in merging two claim services.
In more details, the first implementation, whenever a user have a user attribute in the first claim and the second claim, if this attribute has a value of 0, it will be omitted: "!previousValue" line 73 in src/ClaimService.ts, however the expected output should contain that 0. In the solution provided, this previous value is being checked if it is undefined.

Checklist

  • [ No need to update the api report] This PR makes changes to the public API
  • [ No issue number to be included] I have included links for closing relevant issue numbers

@pamapa
Copy link
Member

pamapa commented Oct 27, 2023

I would rather keep the claims merging as they are now (messy). There is a merge request pending, which aims to fix that. I am planning to fix this in the upcoming major next release. See #881.

Can you verify if the new code would work for you?

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5f6925f) 77.92% compared to head (63458dd) 77.92%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1220   +/-   ##
=======================================
  Coverage   77.92%   77.92%           
=======================================
  Files          45       45           
  Lines        1726     1726           
  Branches      346      346           
=======================================
  Hits         1345     1345           
  Misses        342      342           
  Partials       39       39           
Flag Coverage Δ
unittests 77.92% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/ClaimsService.ts 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pamapa
Copy link
Member

pamapa commented Oct 27, 2023

I now looked at the patch, maybe its still worth to merge this, as it should not change the existing behavior and only fix a edge case...

@pamapa pamapa merged commit b1579d6 into authts:main Oct 27, 2023
4 checks passed
@pamapa pamapa added this to the 2.4.0 milestone Oct 27, 2023
@jeff-chd-g
Copy link
Author

Thank you! Hope to help more!

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