From b05e742c3d947737f87656cd7f4017f41064323b Mon Sep 17 00:00:00 2001 From: apasika Date: Mon, 30 Mar 2026 11:34:07 +0200 Subject: [PATCH 1/2] Fix time jump after jvm freez --- .../plugin/intellij/services/ProjectTimeAccumulator.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/codeclocker/plugin/intellij/services/ProjectTimeAccumulator.java b/src/main/java/com/codeclocker/plugin/intellij/services/ProjectTimeAccumulator.java index 24faf88..0e7be52 100644 --- a/src/main/java/com/codeclocker/plugin/intellij/services/ProjectTimeAccumulator.java +++ b/src/main/java/com/codeclocker/plugin/intellij/services/ProjectTimeAccumulator.java @@ -1,5 +1,6 @@ package com.codeclocker.plugin.intellij.services; +import com.codeclocker.plugin.intellij.tracking.TrackingPersistence; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; @@ -46,6 +47,8 @@ public synchronized void calculateAndAddElapsed(long now) { } long elapsedMillis = now - lastActivityTimestampMillis; + long maxElapsedMillis = TrackingPersistence.getInactivityTimeoutSeconds() * MILLIS_PER_SECOND; + elapsedMillis = Math.min(elapsedMillis, maxElapsedMillis); long elapsedSeconds = Math.round((float) elapsedMillis / MILLIS_PER_SECOND); if (elapsedSeconds > 0) { this.accumulatedSeconds += elapsedSeconds; From 5ffd0b59a95ae51bd5c286b1028d14709004a8a3 Mon Sep 17 00:00:00 2001 From: apasika Date: Mon, 30 Mar 2026 11:36:37 +0200 Subject: [PATCH 2/2] release --- CHANGELOG.md | 9 ++++++++- gradle.properties | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e290356..30f4012 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ ## [Unreleased] +## [1.15.3] - 2026-03-30 + +### Fixed + +- Time tracking no longer accumulates hours during OS suspend (e.g., closing laptop lid) — elapsed time is now capped at the inactivity timeout + ## [1.15.2] - 2026-03-17 ### Fixed @@ -292,7 +298,8 @@ - Support IntelliJ Platform 2024.3.5 -[Unreleased]: https://github.com/codeclocker/codeclocker-intellij-plugin/compare/v1.15.2...HEAD +[Unreleased]: https://github.com/codeclocker/codeclocker-intellij-plugin/compare/v1.15.3...HEAD +[1.15.3]: https://github.com/codeclocker/codeclocker-intellij-plugin/compare/v1.15.2...v1.15.3 [1.15.2]: https://github.com/codeclocker/codeclocker-intellij-plugin/compare/v1.15.1...v1.15.2 [1.15.1]: https://github.com/codeclocker/codeclocker-intellij-plugin/compare/v1.15.0...v1.15.1 [1.15.0]: https://github.com/codeclocker/codeclocker-intellij-plugin/compare/v1.14.0...v1.15.0 diff --git a/gradle.properties b/gradle.properties index 04f49bd..a8445fa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ pluginGroup = com.codeclocker pluginName = CodeClocker pluginRepositoryUrl = https://github.com/codeclocker/codeclocker-intellij-plugin # SemVer format -> https://semver.org -pluginVersion = 1.15.2 +pluginVersion = 1.15.3 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html pluginSinceBuild = 252