Skip to content

chore: fix qodana problems#232

Merged
ghostflyby merged 2 commits into
mainfrom
qodana-fix
Jun 6, 2026
Merged

chore: fix qodana problems#232
ghostflyby merged 2 commits into
mainfrom
qodana-fix

Conversation

@ghostflyby

Copy link
Copy Markdown
Owner

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Qodana for JVM

It 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
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@ghostflyby ghostflyby merged commit 7aa7005 into main Jun 6, 2026
8 checks passed
@ghostflyby ghostflyby deleted the qodana-fix branch June 6, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant