chore: fix qodana problems#232
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d284f2b4e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| recentProjectKeys.forEach(pendingStartupProjects::remove) | ||
| scheduledSyncAtNanos = System.nanoTime() + debounceMillis * NANOS_PER_MILLISECOND | ||
| scheduledSyncAtNanos = Clock.System.now() + debounce |
There was a problem hiding this comment.
Keep debounce deadlines on a monotonic clock
When the system clock is adjusted while a recents sync is debounced (manual time change, NTP correction, sleep/wake time correction), this new wall-clock deadline can make nextWorkerStep() compute the wrong remaining delay: a backward adjustment postpones the macOS recents update by the size of the clock jump, while a forward adjustment flushes it early. The previous System.nanoTime() deadline was monotonic and avoided wall-clock changes affecting the debounce timer.
Useful? React with 👍 / 👎.
Replace Clock.System (wall-clock) with TimeSource.Monotonic for debounce timing in CocoaRecentProjectsCoordinator. Wall-clock adjustments (NTP, sleep/wake, manual time changes) could artificially extend or prematurely trigger the 250ms debounce window. - scheduledSyncAtNanos: Instant -> scheduledSyncDeadline: TimeMark - Clock.System.now() -> TimeSource.Monotonic.markNow() - nextWorkerStep() uses hasPassedNow() / elapsedNow() instead of wall-clock subtraction
Qodana for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
No description provided.