Skip to content

Fix key base equality and spaceship operators#569

Merged
anakinj merged 3 commits intojwt:mainfrom
magneland:fixKeyBaseEqualityAndSpaceshipOperators
Oct 17, 2023
Merged

Fix key base equality and spaceship operators#569
anakinj merged 3 commits intojwt:mainfrom
magneland:fixKeyBaseEqualityAndSpaceshipOperators

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
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