-
Notifications
You must be signed in to change notification settings - Fork 466
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
Useless HashDiff comparison when saving resource #1037
Comments
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days. |
Here is another case where HashDiff is causing bug.
Currently when you update ShopifyAPI::Customer without email (with the example above), you receive error:
This is probably another bug, because you can not send email_marketing_consent as nil when there is no email . So the workaround for this bug is to remove
But this example above is causing the same error:
when removing the
|
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days. |
We are closing this issue because it has been inactive for a few months. If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines Thank you! |
@kaarelss excellent job finding and describing this bug. So disappointing that no one is doing anything about it. |
Fixed with #1149 |
Issue summary
When updating/saving any resource, there is useless HashDiff comparison. It looks like the intended logic is to not send attributes which are not changed, but all attributes are sent always, because comparison result contains duplicate attributes as symbols and as strings.
Expected behavior
original_state should return hash with same attribute types as to_hash methods result, so the HashDiff comparison works correctly.
Actual behavior
original_state return hash with keys as symbols, but to_hash return hash with keys as strings. Therefore the HashDiff comparison have both sets of attributes.
Steps to reproduce the problem
Look at the image, you can see that there are duplicate set of attributes after HashDiff comparison.
![Screenshot at Oct 12 09-58-32](https://user-images.githubusercontent.com/11540218/195273145-0d3a82ab-0e94-4964-baa5-56d3c19c3987.png)
Logs
Specifications
shopify_api
version: 12.0.02022-04
):@itissible/matrixify
The text was updated successfully, but these errors were encountered: