Datetimes sent to the server as timezone-naive #385

Closed
opened 2023-11-13 11:45:39 +02:00 by inex · 0 comments

Expected Behavior

When sending datetimes to the server, these should be timezone-aware, because the user and the server may be in different timezones. However, turns out that Dart's toIso8601String only adds timezone if the DateTime object is in UTC.

Actual Behavior

Datetimes are sent to the server without timezone data.

Steps to Reproduce

  1. Create a new recovery key with expiration date
  2. See the request variables
  3. There is no Z or timezone offset at the end of the datetime string

Context and notes

All Datetimes should be trasformed to UTC before sending to the server with date.toUtc().toIso8601String(). In some places, it is already used.

Relevant log output

No response

App Version

0.9.1

Server API Version

2.4.2

Operating System

Android

### Expected Behavior When sending datetimes to the server, these should be timezone-aware, because the user and the server may be in different timezones. However, turns out that Dart's [toIso8601String](https://api.dart.dev/stable/3.1.5/dart-core/DateTime/toIso8601String.html) only adds timezone if the `DateTime` object is in UTC. ### Actual Behavior Datetimes are sent to the server without timezone data. ### Steps to Reproduce 1. Create a new recovery key with expiration date 2. See the request variables 3. There is no `Z` or timezone offset at the end of the datetime string ### Context and notes All Datetimes should be trasformed to UTC before sending to the server with `date.toUtc().toIso8601String()`. In some places, it is already used. ### Relevant log output _No response_ ### App Version 0.9.1 ### Server API Version 2.4.2 ### Operating System Android
inex added the
Bug
Priority
Medium
Severity
Medium
labels 2023-11-13 11:45:39 +02:00
NaiJi was assigned by inex 2023-11-13 11:45:39 +02:00
NaiJi closed this issue 2023-11-18 07:31:29 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: SelfPrivacy/selfprivacy.org.app#385
There is no content yet.