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

Change tracking will capture the wrong objectID in some special cases. #60

Open
Sv7enNowitzki opened this issue Jan 10, 2024 · 0 comments

Comments

@Sv7enNowitzki
Copy link
Collaborator

Sv7enNowitzki commented Jan 10, 2024

Hello,

When I was debugging change tracking, I found that in the following modeling and annotation, certain special cases resulted in capturing the wrong objectID:
image
image

Because in modeling, Buildings entity has a name field, and the ObjectID annotation also needs to capture the name field of the final entity from goods.goods.goods.name. In fact, the two name fields represent different content.

When we set the value 'test buildings' to the name of the Buildings entity in our app, and Goods is empty, the ObjectID we expect is only: 'test buildings', because all the other values are empty. But in this case, because Buildings have a field called name, and path: 'goods.goods.goods.name' ends up with a field called name, the ObjectID will be: 'test buildings, test buildings'. You can see that we now have the wrong ObjectID.
image
image

And here's the problem:
https://github.com/cap-js/change-tracking/blob/main/lib/entity-helper.js#L99

This is my solution:
image

If you have time, please take a look at this scenario.

Best Regards,
Wenjun

nkaputnik pushed a commit that referenced this issue Mar 19, 2024
…65)

Fix issue

[Change tracking will capture the wrong objectID in some special
cases.](#60)

Co-authored-by: I560824 <wenjun.zheng@sap.com>
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

No branches or pull requests

1 participant