PostHog / PostHog/posthog-flutter

Use network time instead of device time

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

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

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

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.