Open lennart-m opened 3 weeks ago
Are you using the new odata adapter
or the old one? I think this issue is only present when using the new adapter.
Hi @hakimio According to the logs it's the new one.
[cds] - using new OData adapter
I tested it with the legacy adapter and it seems to work. Are there any downsides to be expected with the legacy adapter? I'm currently not using any special OData features like aggregate
so feature-wise it shouldn't make a lot of difference.
Also, should I raise this issue somewhere else, if the problem is not with the DB service itself? Will I have to create a SAP incident?
Thanks a lot! Lennart
The new adapter has better performance, few more features, strict validator and doesn't crash the server on unhandled errors.
EDIT: starting with v8.4.0
the new odata adapter also crashes on unhandled errors like the old one did.
I don't know what I tested before, but it still does not work, even with the legacy adapter. The input always gets interpreted as UTC, resulting in the app displaying different data after saving.
Hi, I have an issue with saving timestamp fields to the database using the
@cap-js/postgres
adapter. The entered timestamp data is equipped with a time zone that is lost when the data gets saved to the database.Example
I have a very simple entity with some test fields:
And a simple test service:
Now I am using Chrome in Windows 11 with Time Zone CEST. When I enter the value
23.10.2024, 12:00:00
in my fiori elements app and save, it will change to23.10.2024, 14:00:00
. So my input is interpreted as UTC while I meant it to be in my local time.The outgoing batch request issued by my browser contains the CEST time:
CAP logs this request as follows:
So you see the CEST time (
dati = 2024-10-23T12:00:00+02:00
) is forwarded to the database. CAP itself does not convert the timestamp to UTC, contrary to what the documentation claims here.I tried setting the time zone to
Europe/Berlin
orEtc
using theTZ
environment variable, but it did not change anything.Also, due to draft handling, I cannot seem to intervene using some CAP middlewares. When my
before
handler executes, it only gets the data from the drafts table, which might be correct, or not.Both fields
Timestamp
andDateTime
show this behavior.Version information
I found some SAP question that looks exactly like my issue, but does not contain a real solution. Sending the data as UTC via OData would probably help but unfortunately that is not what Fiori Elements does, and debugging Fiori Elements is quite hard.
Thanks a lot in advance!
Lennart