KronosClock returns stale cached time after device reboot if syncInBackground is called before getCurrentTime
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lyft/Kronos-Android
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
lyft/Kronos-Android#66 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
lyft/Kronos-Android#65 ·
-
Wrong TimeOpen
Difficulty 4/5 3-5 days Newbie friendliness 25/100
lyft/Kronos-Android#62 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
lyft/Kronos-Android#61 · 10 comments · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
lyft/Kronos-Android#53 ·
All issues in lyft/Kronos-Android
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
fwcd/tree-sitter-kotlin#289 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
navikt/syfo-oppfolgingsplan-backend#482 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
MorphiaOrg/morphia#4332 ·
Maintainers usually reply within 1 day