lyft / lyft/Kronos-Android

getCurrentTimeMs() return the wrong date time everytime I manually change the device clock

Open
#61 10 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
287
Forks
17
PR merge metrics
No merged PRs in 30d

Description

If I do something like:

- Open my app
- Minimize it and go to System > Date & Time and then change the device clock for some wrong date & time
- Then come back to my app and try to call `getCurrentTimeMs() ` this will give me the wrong date that I manually setup

If I have an internet connection, after that wrong response the next one works as expected, giving me the right date & time.

If that is expected behavior could you please explain a little bit more why this happens? And what do you recommend to minimize that behavior?

I am now calling `kronosClock.syncInBackground();` every time my app goes to the foreground, please let me know if there is any other better strategy to deal with it.

Thank you in advance, and congrats for the work, apart from that minor issue this library is great!

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by reproducing the behavior around getCurrentTimeMs() after changing the device clock, then inspect the syncInBackground() entry point used when the app returns to the foreground. Done means determining whether the result is expected and documenting or defining a recommended strategy for handling clock changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.