Fix JSONAPI::PathSegment::Relationship#eql?#1334
Fix JSONAPI::PathSegment::Relationship#eql?#1334lgebhardt merged 1 commit intoJSONAPI-Resources:masterfrom
Conversation
Relationship objects are used as key in @join_details in JoinManager. This hash contains two types of objects: String and Relationship In case of hash collisions in @join_details the method Relationship#eql? is called. It currently fails when comparing with a string key. Fixes JSONAPI-Resources#1333
|
This bug has been biting me bad lately and it's really hard to reproduce. Going to merge your PR into my branch and ship it out. |
|
@larskanis Thanks for finding and fixing that |
|
I ran into this today after upgrading from ruby 2.5.3 to 2.7.2. Looking at the fix I can't figure out how this would be related to the version upgrade, and never came across this before. Does anyone know if this is a bug specific to 2.7? Or is it just really unlikely? |
In my experience chasing this particular bug, it's presented itself so sporadically that it was quite the chore chasing down. @larskanis was the only other person I found and he managed to create a failing test and his methodology was the only one that could prove it's existence. |
|
I looked through the source and it doesn't seem like this ever made it into an official release? Is this fix the same as #1368 ? Confused why this is in the |
|
Hi @lgebhardt ! Will this fix be included to the next release? We still facing the issue on 0.10.4 in production. |
|
@mikhaillopandia Thanks for the reminder. I'll get this merged into the v0.10 branch and see if I can get a release out this week. |
Relationship objects are used as key in
@join_detailsin JoinManager . This hash contains two types of objects: String and Relationship. In case of hash collisions in@join_detailsthe methodRelationship#eql?is called. It currently fails when comparing with a string key.Fixes #1333
All Submissions:
Bug fixes and Changes to Core Features:
Test Plan:
There's no reliable way to test for hash collisions. It would be possible to specifically test for
Relationship#eql?(""). Shall I add such a test?Reviewer Checklist: