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(kitsu-core): Merge meta keys to preserve data #853

Merged
merged 2 commits into from
Apr 26, 2023

Conversation

pedep
Copy link
Contributor

@pedep pedep commented Apr 26, 2023

Previously only the meta from the resource identifier object was preserved, while the resource object meta was discarded, resulting in some cases where meta would be set to undefined.

The meta keys are now merged instead of picked between, preserving the largest amount of data possible.

I arbitrarily decided to prioritize the resource identifier objects meta if there are any conflicting keys. This can easily be reversed just by swapping keys in the spread.

closes #843

Previously only the meta from the resource identifier object was preserved,
while the resource object meta was discarded, resulting in some cases
where meta would be set to undefined.

The meta keys are now merged instead of picked between, preserving the
largest amount of data possible.
@wopian
Copy link
Owner

wopian commented Apr 26, 2023

Thank you! Hopefully I can find the time to continue working on #818 too 🙏

@codeclimate
Copy link

codeclimate bot commented Apr 26, 2023

Code Climate has analyzed commit 83519f0 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

The test coverage on the diff in this pull request is 100.0% (100% is the threshold).

This pull request will bring the total coverage in the repository to 100.0% (0.0% change).

View more on Code Climate.

@wopian wopian merged commit 474d91b into wopian:master Apr 26, 2023
@pedep pedep deleted the fix(kitsu-core)/meta-object-merge branch April 26, 2023 15:29
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.

Deserialise method misses meta (meta: undefined) in case of relationships with links and data
2 participants