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

Add support for client timezone information #1024

Open
fmrsabino opened this issue Jan 15, 2024 · 0 comments
Open

Add support for client timezone information #1024

fmrsabino opened this issue Jan 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fmrsabino
Copy link
Collaborator

fmrsabino commented Jan 15, 2024

If the user is in a timezone that follows daylight saving, the transaction history grouping is done without taking it into consideration.

Problem

If a user is in a UTC+1 timezone (winter) and UTC+2 (summer), a transaction done during daylight savings will be incorrectly grouped when daylight savings are not observed.

When daylight savings is not being observed, the clients send a UTC+1 difference in milliseconds (3600000 ms). The Safe Client Gateway will then create transaction groups taking only the 3600000 shift into consideration.

If the clients use a solution that takes daylight savings into consideration, this might cause some transactions to be rendered with UTC+2 and potentially making the group that was created with UTC+1 to contain transactions of the following/previous day.

Example

  • TX1 done on Sun Jul 30 2023 22:46:47 UTC+0000.
  • TX2 done on Sun Jul 30 2023 21:46:47 UTC+0000
  • Client on UTC+1 Winter, UTC+2 Summer
  • Client is on Winter timezone
  1. Client sends timezone offset of +1 hour
  2. CGW computes groups with 1 hour difference.
  3. CGW returns a group with July 30 (22:46:47 UTC+0000) with transactions TX1 and TX2
  4. Clients, aware of daylight savings, shift the header label to July 31 (00:46:47 UTC+2) that will include TX1 and TX2 while there should be two groups rendered: July 31 with TX1 and July 30 with TX2.

The transaction was therefore shifted to a different day on the client side while it should've been grouped correctly on the CGW side.

Expected Result

Given the same example as the one above:

  1. Client sends timezone offset of +1 hour
  2. CGW computes groups with 1 hour difference and takes into consideration daylight savings.
  3. CGW returns two groups:
  • July 30 (22:46:47 UTC+0000) with TX1
  • July 30 (21:46:47 UTC+0000) with TX2
  1. Clients, aware of daylight savings, shift the first header label to July 31 (00:46:47 UTC+2) which includes TX1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant