Remove offset from received timestamps when writing them to DB#1029
Remove offset from received timestamps when writing them to DB#1029Toastbrot236 wants to merge 2 commits intoLittleBigRefresh:mainfrom
Conversation
… before writing them to DB
|
Closing, as this both avoids and even enhances the actual issue, which consists of Bunkum's JSON parser wrongfully parsing datetimes, which don't have a Z and also don't have an offset, into UTC and then appending its own environment's timezone offset. This means that the parsed timestamp will be different from what was received, which is unacceptable (would be better if the parser would either throw or just parse it as UTC without adding a bogus offset which wasn't there before). For now, not accepting any datetimes with offsets means we will filter out such cases of badly parsed datetimes, at the cost of also rejecting datetimes which do have an offset set in the JSON. Ideally, the parsing issue would somehow have to be fixed in Bunkum. We could also temporarily introduce a workaroud where we parse all JSON requests (or atleast just the datetimes) ourselves by using an EndpointService or something similar, but that might have its own disadvantages. |
Closes #1028 by setting
GameContest.StartDate,GameContest.EndDateandGameUser.BanExpiryDateto the UTC variant of theDateTimeOffsets received from API requests. Also includes tests for both cases.