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: Reassign alias language id safely #322

Merged
merged 1 commit into from
Nov 18, 2019
Merged

fix: Reassign alias language id safely #322

merged 1 commit into from
Nov 18, 2019

Conversation

MonkeyDo
Copy link
Contributor

Fix issue with language property being reassigned by object destructuring (introduced in PR #308 ).
Also refactor other entities to use the same protection (use languageID instead of language.id in case language is undefined)

Fix issue with language being reassigned by object destructuring (introduced in PR #308), and refactor other entities to use the same protection
@coveralls
Copy link

Coverage Status

Coverage remained the same at 43.014% when pulling a7f873b on fix-alias-id into 6914c74 on master.

@MonkeyDo
Copy link
Contributor Author

@panwarabhishek345 For your information, I found a bug pr #308 that I hadn't seen coming !
Basically, with {language: languageID, …rest}, we assign language, but if language is present in rest, it gets reassigned by …rest.
So instead, we should destructure rest first, and only after that, reassign language.

@MonkeyDo MonkeyDo merged commit 03e683f into master Nov 18, 2019
@MonkeyDo MonkeyDo deleted the fix-alias-id branch November 18, 2019 14:51
@panwarabhishek345
Copy link
Contributor

True, I should have taken care of that.

@MonkeyDo
Copy link
Contributor Author

I didn't see it at all, neither during review nor testing, which means I didn't test well enough on my side !

It's a sneaky one, hard to see when using object destructuring !

kellnerd added a commit to kellnerd/bookbrainz-site that referenced this pull request Jul 9, 2024
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.

3 participants