Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle day-specific requests accounting time zones #8

Open
dbonino opened this issue Apr 28, 2020 · 2 comments
Open

Handle day-specific requests accounting time zones #8

dbonino opened this issue Apr 28, 2020 · 2 comments

Comments

@dbonino
Copy link

dbonino commented Apr 28, 2020

Currently the back-end retrieves "onset" data for a given day based on a day information specified as a LocalDate. This is likely to generate errors for all users having a device working in a timezone different from the one of the server. In fact, the method public List<Exposee> getSortedExposedForDay(LocalDate day) is not timezone aware and therefore is prone to timezone related errors. (As reported in official Javadocs This class does not store or represent a time or time-zone. Instead, it is a description of the date, as used for birthdays. It cannot represent an instant on the time-line without additional information such as an offset or time-zone.

E.g., if the timezone of my device is set to UTC for whatever reason, the request sent by the device will contain a day specification, which is implicitly referred to the device timezone. However, as it is interpreted as "local" datetime on the server, the result will consider an interval which is shifted by 1 hour (or 2, depending on the daylight saving period).

This might introduce errors in notifications to users.

@dcremonini
Copy link
Collaborator

Just for keeping the content of your post current, the onSet field of type String was recently renamed keyDate and its type was changed to long. I agree that managing the timezone someway is very important.

@slyfer
Copy link
Collaborator

slyfer commented May 3, 2020

The get exposed parameter is a Date (first string now a long (epoch millis)) sono timezone is not relevant.

@brushtyler brushtyler transferred this issue from noiapp/noiapp-backend-old May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants