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 key base equality and spaceship operators #569

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

magneland
Copy link
Contributor

@magneland magneland commented Oct 13, 2023

I ran into this issue when trying to use Rails.cache.fetch.

Specifically there is a fallback condition that tried to compare:

@value == true (where @value was a JWK)

and this gem raised an error:

undefined method `[]' for true:TrueClass

I haven't run into the spaceship operator issue, but I figured it is similar enough to fix at the same time.

@magneland
Copy link
Contributor Author

FYI I followed some of the recommendations here: https://shopify.engineering/implementing-equality-in-ruby

@anakinj
Copy link
Member

anakinj commented Oct 14, 2023

Thank you for taking time fixing this.

Would you have the time to add a changelog entry for this into the changelog file. I had forgotten to update it after the last release, fixed now on main so if you rebase your branch you should have a place to add an entry.

@magneland magneland force-pushed the fixKeyBaseEqualityAndSpaceshipOperators branch from a945343 to 82b0fc5 Compare October 16, 2023 23:25
@anakinj anakinj merged commit e1fce4e into jwt:main Oct 17, 2023
30 checks passed
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