fix(license): check a revoked key as soon as it is entered #386

Merged
maximus merged 2 commits from issue-373-revocation-check-on-entry into main 2026-10-05 23:22:41 +00:00
Showing only changes of commit 0b94ccf006 - Show all commits

View file

@ -2624,7 +2624,9 @@ mod tests {
// === One check at a time (#373) ===========================================================
//
// Each test has its own turn, standing for `REVOCATION_CHECK_TURN`: tests run on parallel
// threads, and a turn shared between them would decide which check goes first.
// threads, and a turn shared between them would decide which check goes first. `join!` is
// `biased`: its first branch is polled first, every time, so it is the check that starts
// first.
/// A turn of its own for one test.
fn new_turn() -> tauri::async_runtime::Mutex<()> {
@ -2649,6 +2651,7 @@ mod tests {
let turn = new_turn();
let (first, second) = tokio::join!(
biased;
check_revocation_in_turn(&turn, &dir.0, &url, &dec, || NOW),
check_revocation_in_turn(&turn, &dir.0, &url, &dec, || NOW),
);
@ -2694,6 +2697,7 @@ mod tests {
let turn = new_turn();
let (first, second) = tokio::join!(
biased;
check_revocation_in_turn(&turn, &dir.0, &url, &dec, || NOW),
async {
store_license_in(&dir.0, &new_key, &dec).unwrap();
@ -2735,6 +2739,7 @@ mod tests {
let running = turn.lock().await;
let (dir_ref, clock_ref, key_ref) = (&dir, &clock, &key);
let (result, ()) = tokio::join!(
biased;
check_revocation_in_turn(&turn, &dir.0, &url, &dec, || {
clock.load(std::sync::atomic::Ordering::SeqCst)
}),