Title: Read epoch instants from EpochClock instead of CurrentDateProvider · Issue #6583 · getsentry/sentry-java · GitHub
Open Graph Title: Read epoch instants from EpochClock instead of CurrentDateProvider · Issue #6583 · getsentry/sentry-java
X Title: Read epoch instants from EpochClock instead of CurrentDateProvider · Issue #6583 · getsentry/sentry-java
Description: Several internal call sites use CurrentDateProvider only to read the current epoch time. options.getEpochClock() gives the same value. Moving them now changes nothing that is sent, and it shrinks what v9 has to change when it removes ICu...
Open Graph Description: Several internal call sites use CurrentDateProvider only to read the current epoch time. options.getEpochClock() gives the same value. Moving them now changes nothing that is sent, and it shrinks w...
X Description: Several internal call sites use CurrentDateProvider only to read the current epoch time. options.getEpochClock() gives the same value. Moving them now changes nothing that is sent, and it shrinks w...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/6583
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Read epoch instants from EpochClock instead of CurrentDateProvider","articleBody":"Several internal call sites use `CurrentDateProvider` only to read the current epoch time. `options.getEpochClock()` gives the same value. Moving them now changes nothing that is sent, and it shrinks what v9 has to change when it removes `ICurrentDateProvider` (getsentry/sentry-java#6506).\n\n## Call sites\n\n* `AnrV2Integration` and `TombstoneIntegration` pass the provider to `ApplicationExitInfoHistoryDispatcher`, which computes the 90-day cutoff for `ApplicationExitInfo` timestamps.\n* `MemoryLimiterIntegration` passes it to the same dispatcher.\n* `SentryOkHttpInterceptor` and `SentryOkHttpEvent` stamp `HTTP_START_TIMESTAMP` and `HTTP_END_TIMESTAMP` for replay network details.\n\nEach one compares against or sends an epoch instant, so each has to stay on the wall clock. `EpochClock` is the wall clock. On Android it reads `System.currentTimeMillis()`. On Java 9+ it reads `Instant`, which gives the same millisecond.\n\nNone of this is public API. The integrations' constructors that take an `ICurrentDateProvider` are package-private and only used by tests.\n\n## Out of scope\n\n* `LifecycleWatcher`: already moved on `9.x.x` by #6096. Changing it on main would only cause a conflict.\n* `RateLimiter` and `ReplayIntegration`: their `ICurrentDateProvider` constructors are public API, so they change in v9 (getsentry/sentry-java#6506).\n* `Debouncer` and `AndroidEnvelopeCache`: getsentry/sentry-java#6104.\n* The replay capture strategies: getsentry/sentry-java#6522.\n\n## Done when\n\n* None of the call sites above references `CurrentDateProvider`.\n* Tests inject a fake `EpochClock`.\n* No `.api` diff and no changelog entry, because nothing users can see changes.\n\n\u003cdetails>\u003csummary>Agent notes\u003c/summary>\n\nVerified on `main` at `812682636b` (2026-11-12).\n\n* `AnrV2Integration.java:56` (default ctor), `:59-60` (test ctor), `:91` (dispatcher).\n* `TombstoneIntegration.java:60`, `:63-64`, `:100`.\n* `MemoryLimiterIntegration.java:96`, `:100-102`, `:152`.\n* `ApplicationExitInfoHistoryDispatcher.java:60` (ctor param), `:66` (`threshold = now - NINETY_DAYS_THRESHOLD`).\n* `sentry-okhttp`: `SentryOkHttpEvent.kt:54`, `:180`; `SentryOkHttpInterceptor.kt:112` (breadcrumb start), `:272`.\n* `EpochClock.now()` returns a `Timestamp`; convert with `TimeUnit.NANOSECONDS.toMillis(now.epochNanos())`, the way `LifecycleWatcher` does on `9.x.x`.\n* Reduces the `@SuppressWarnings(\"deprecation\")` count for the deprecation ticket in this project, so land this first if both are in flight.\n\n\u003c/details>","author":{"url":"https://github.com/runningcode","@type":"Person","name":"runningcode"},"datePublished":"2026-11-12T08:18:31Z","url":"https://github.com/getsentry/sentry-java/issues/6583"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cf80f8d6-f760-f724-bf8d-830a7773408b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A486:12D34E:7479B:A2362:6B04626D |
| html-safe-nonce | 06faf6d480e61f8c84ecb764d2223c0b90281a06b575f6943d5c4b1abf0f3b72 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDg2OjEyRDM0RTo3NDc5QjpBMjM2Mjo2QjA0NjI2RCIsInZpc2l0b3JfaWQiOiI0MDQxNjY1ODE2MTkyOTAxNzQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 384d444735423f2fefda70709ca2b69e9ec413ba9489422e01ed3f7a4a05eb47 |
| hovercard-subject-tag | issue:6345775653 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/6583/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4bd0c21fb1c5e83ea839bf3023d20080c93aa65e17fb0586cfb1151b1cf22aac/getsentry/sentry-java/issues/6583 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4bd0c21fb1c5e83ea839bf3023d20080c93aa65e17fb0586cfb1151b1cf22aac/getsentry/sentry-java/issues/6583 |
| og:image:alt | Several internal call sites use CurrentDateProvider only to read the current epoch time. options.getEpochClock() gives the same value. Moving them now changes nothing that is sent, and it shrinks w... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | runningcode |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 03e114520787ad27289207f153520ef97461127c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width