Closed stockbal closed 2 weeks ago
Hello @stockbal we have picked this up and will be working on it.
Best, Nick
Hi @stockbal
We believe that this issue is one that the CAP framework needs to address, as it is essentially due to the differences in behavior among databases, which are then reflected in the req.diff
API.
Perhaps we should communicate with the CAP team to resolve this, addressing the problem at the framework level rather than at the plugin level.
I have already submitted an issue to the CAP team and am currently in communication with them: https://github.tools.sap/cap/issues/issues/16878
Best Regards, Wenjun
Hi @stockbal
After discussing with the CAP team, as they mentioned in their issue, there indeed are such problems with the current req.diff
. They are currently working on a new solution.
If we want to solve similar problems, for now, we can only address them within the project itself. Therefore, I have submitted a PR, which has already been merged into the main branch. Thank you for your patience. It will be available in next release.
Best Regards, Wenjun
Hi,
we are currently using the change-tracking plug-in in a CAP project that is deployed on cloud foundry and uses SAP HANA Cloud as a database. Locally with SQLite every works pretty well, but after deployment we see many change entries where numeric values have not really changed.
npm versions
Defined cds entity
Example 1: Update operation via OData service
Example 2: Update operation via CQL query on projection
As you can see, the issue can be traced to the HANA driver always filling up the defined decimal places with zeros. In case of sending 3.5 to the database, you will get back a string of value "3.5000" if selecting the entry again.
One fix could be to always cast both old and new value to
Number
and compare that, in case the data type iscds.Decimal
.Regards, Ludwig