Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

KronosClock returns stale cached time after device reboot if syncInBackground is called before getCurrentTime

Open
#67 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
kotlin
Domain
networking

Research direction

Start in SntpService by tracing syncInBackground, getCurrentTime, state, and isCachedFromPreviousBoot during reboot handling. Review PR #51 and issue #61 for the related state behavior; done means stale cached time is not returned during synchronization and the cache is not cleared incorrectly after manual time changes.

Written by the indexing model from the issue text.

Description

PR https://github.com/lyft/Kronos-Android/pull/51 attempted to fix an issue where the local cache was not cleared after a device reboot, but it overlooked another edge case.

If the user calls syncInBackground before getCurrentTime, the SntpService.state variable will be set to State.SYNCING. As a result, the isCachedFromPreviousBoot check always evaluates to false while the sync is in progress. This creates a short window (a few seconds) during which getCurrentTime may return an incorrectly computed time based on a stale local cache.

Additionally, PR https://github.com/lyft/Kronos-Android/pull/51 removes State.INIT, which introduces another issue described in https://github.com/lyft/Kronos-Android/issues/61, where the local cache is cleared every time the user manually changes the system time.

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

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from lyft/Kronos-Android

All issues in lyft/Kronos-Android

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.