Skip to content

fix: count a validation ahead of the device clock as overdue - #51

Merged
TobbenTM merged 1 commit into
mainfrom
bandung-v2/clock-rollback-throttle-fix
Nov 9, 2026
Merged

TobbenTM merged 1 commit into
mainfrom
bandung-v2/clock-rollback-throttle-fix

Conversation

@TobbenTM

@TobbenTM TobbenTM commented Nov 9, 2026

Copy link
Copy Markdown
Member

validate_token_online measured the time since the last validation by the device clock, so with that clock behind validated_at the age came out negative, passed both the min_interval throttle and the grace period, and the license was not re-checked until the clock caught up, online or not. A validated_at more than 5 minutes ahead of the clock now reads as the longest possible time (Moonbase is asked, and a failure to reach it is past the grace period), while up to 5 minutes is taken as ordinary skew so sibling instances still hit the throttle right after a check. The JUCE controller's three grace checks (the license watch, a failed refresh, and a license another instance stored) now use the same rule, and the core SDK and JUCE module docs say how the clock is used. New core and JUCE tests cover a validation an hour ahead (Moonbase answering and unreachable) and 30 seconds ahead (still throttled); all but the 30-second case fail without the fix, and both suites pass on macOS, with a GCC 13 compile check on Linux.

validate_token_online measured the time since the last validation as now
minus validated_at. With the device clock behind that time, the result was
negative, which passed both the min_interval throttle and the grace period,
so the license was never re-checked until the clock caught up, online or
not.

A validated_at more than 5 minutes ahead of the clock now reads as the
longest possible time: Moonbase is asked, and a failure to reach it is past
the grace period. Up to 5 minutes is taken as ordinary skew between the
device and Moonbase, so sibling instances still hit the throttle right after
a check. The JUCE controller's grace checks (the license watch, a failed
refresh, and a license another instance stored) use the same rule.
@TobbenTM
TobbenTM merged commit e17bc4b into main Nov 9, 2026
11 of 19 checks passed
github-actions Bot pushed a commit that referenced this pull request Nov 9, 2026
## [4.13.4](v4.13.3...v4.13.4) (2026-11-09)

### Bug Fixes

* count a validation ahead of the device clock as overdue ([#51](#51)) ([e17bc4b](e17bc4b))
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 4.13.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant