PostHog / PostHog/posthog-flutter
Use network time instead of device time
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 97
- Forks
- 85
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 31
Description
Description
Relates to https://github.com/PostHog/posthog-android/issues/223
Description
- Android
- iOS (https://github.com/PostHog/posthog-ios/issues/339)
- Flutter (this issue)
- RN (https://github.com/PostHog/posthog-js/issues/3808)
Alternatives: https://android-developers.googleblog.com/2025/02/trustedtime-api-introducing-reliable-approach-to-time-keeping-for-apps.html?m=1
https://developer.android.com/reference/android/os/SystemClock#currentNetworkTimeClock() (API 33)
https://github.com/instacart/truetime-android
Analytics data, recordings, etc, all depend on the timestamp. The server does clock drifting if it's off in the past or future, but that's not ideal.
Devices can be way in the past, future or just off by a few minutes due to user's settings, I believe using a network time would be way better
Contributor guide
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.
Research direction
No files, tests, or entry points are named. Start by reading the linked Android, iOS, and RN issues, then locate where the Flutter SDK creates timestamps and compare the listed network-time alternatives. Done should mean the SDK consistently uses a defined network-time approach for analytics data and recordings, with behavior and platform constraints documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100