RealDevSquad / RealDevSquad/website-backend

Design Doc for the From and Until Timestamps fix for OOO

Open
#1,580 2 comments 0 reactions 1 assignee View on GitHub

@heyrandhirs is already working on this.

Since Oct 2, 2023.

Dominant language
JavaScript
Stars
74
Forks
276
Avg merge
1d 26m
Merged PRs (30d)
14

Description

Problem Statement

  • As of now when a user selects OOO from website-my, the timestamp is stored as the 00:00:00 UTC timestamp for the chosen date.
  • Problem arises when the user chooses to be on OOO for one day. Suppose a user chooses to be on OOO from 02/10/2023 till 02/10/2023, then both the from and until timestamps are chosen as the 00:00:00 UTC timestamps for both. In this case, 1696204800000.
  • Hence, the from and until timestamps become equal resulting in a OOO for 0 ms. This would cause problems when updating the OOO dates in the user's discord nickname.
  • With this issue, the from and until timestamp for the day must be set to 00:00:00 UTC and 23:59:59 UTC respectively.

Refer to the screenshot higlighting the issue
image

Solution

  • As the from timestamp is correct i.e at UTC 00:00:00. We will need to convert the to timestamp to respective time of the day at 23:59:59 UTC`.
  • This needs to be done at all the places where the user is being marked as OOO.

Issue Ticket : https://github.com/Real-Dev-Squad/website-backend/issues/1579

ETA Breakdown:

  • Design Doc: 1 day
  • Code Changes : 1 day
  • Tests : 1 day
  • Review+Buffer: 3 day
  • Completion : 9th Oct 2023

Please feel free to add any comments if you have any suggestions / improvements.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.