Skip to content

fix(clearance): poll for sw keepalive alarm confirmation - #210

Merged
ChechiDev merged 1 commit into
mainfrom
fix/sw-keepalive-alarm-polling
Sep 24, 2026
Merged

ChechiDev merged 1 commit into
mainfrom
fix/sw-keepalive-alarm-polling

Conversation

@ChechiDev

Copy link
Copy Markdown
Owner

Summary

  • Adds bounded polling loop to make_sw_keepalive_checker so transient False alarm reads retry before blocking the harness
  • Retries up to 6 times at 0.5s intervals when swKeepalive alarm is absent (False); stops early on True
  • Preserves None as the SW-unreachable diagnostic — not retried, not misreported as alarm-missing
  • Worst-case polling: 6 × 0.5s = 3.0s inside the existing 10s _DIAGNOSTIC_READ_TIMEOUT_S envelope
  • No extension behavior changed; no real smoke executed

Root cause

Real smoke on v0.47.10 blocked at sw_keepalive_confirmed with sw_keepalive_alarm_present: False. The MV3 extension creates the swKeepalive alarm asynchronously in chrome.storage.onChanged; the previous single-shot CDP read raced against that creation and consistently saw the alarm absent.

Test plan

  • test_false_is_retried_and_resolves_true — False retries, True terminates early
  • test_false_repeatedly_returns_false_after_max_attempts — bounded loop, not infinite
  • test_none_not_retried_returns_none — SW-unreachable exits on first call
  • test_false_then_none_returns_none — mid-retry None is returned correctly
  • All 65 existing unit tests in the two targeted suites pass
  • ruff check and flake8 clean

Closes #209

@ChechiDev ChechiDev added the type:bug Bug fix label Sep 24, 2026
@ChechiDev
ChechiDev merged commit 2e0f41d into main Sep 24, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(clearance): poll for sw keepalive alarm confirmation

1 participant