You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We upgrade to"@sap/cds": "8.x.x" from "@sap/cds": "7.x.x", and face the following problem.
We have an entity that has a property that is typed as DateTime or Timestamp (in the cds model).
We insert a instance into the entity with INSERT.into ...
In javascript / typescript, the property is of type Date (not: string).
Before the upgrade this worked.
After the upgrade we get in node_modules/@cap-js/change-tracking/lib/change-log.js:177:44 the error "Cannot read properties of undefined (reading 'split')" See also the screenshot from my local environment:
When we instead do the INSERT statement with the property being a string instead of Date, we don't get this error.
The CAP runtime seems to accept the type Date. Therefore, our expectation is that also change tracking should accept Date.
run unit test "01. Add an entry to the BusinessPartners entity -> this should be selected properly" in file lib/masterData/businessPartners/DbBusinessPartnerRepository.ts; this results in the above-mentioned error
Can you please check and advise.
Thank you and best regards,
Stefan
We use CAP with NodeJs.
The text was updated successfully, but these errors were encountered:
I have submitted a PR to address the error you mentioned in the issue.
However, I need to clarify that change tracking typically does not perform additional formatting for types like DateTime. Therefore, when you input as a JavaScript Date Object, there might be a problem with the old and new values having different formats.
Upon my testing, I found that this issue arises due to the use of different database services. The problem occurs when the we use @cap-js/sqlite or @cap-js/hana. Using the old database service like sqlite3 does not exhibit the aforementioned issue.
I have already raised an issue with the cds-dbs team regarding this situation and am awaiting their response.
Hello colleagues
We upgrade to"@sap/cds": "8.x.x" from "@sap/cds": "7.x.x", and face the following problem.
We have an entity that has a property that is typed as DateTime or Timestamp (in the cds model).
We insert a instance into the entity with
INSERT.into ...
In javascript / typescript, the property is of type Date (not: string).
Before the upgrade this worked.
After the upgrade we get in node_modules/@cap-js/change-tracking/lib/change-log.js:177:44 the error
"Cannot read properties of undefined (reading 'split')"
See also the screenshot from my local environment:When we instead do the INSERT statement with the property being a string instead of Date, we don't get this error.
The CAP runtime seems to accept the type Date. Therefore, our expectation is that also change tracking should accept Date.
To reconstruct:
Can you please check and advise.
Thank you and best regards,
Stefan
We use CAP with NodeJs.
The text was updated successfully, but these errors were encountered: