Repository navigation
Conversation
chrome.storage.onChanged may not fire when config is written via CDP, so startAlarmIfNeeded() never ran and swKeepalive was never created. Step 6 in inject_storage_config_to_extension now calls chrome.alarms.get + chrome.alarms.create directly from the SW CDP session, bypassing the onChanged dependency entirely.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #211
Problem
During real clearance smoke testing (CP-SMOKE-B),
sw_keepalive_confirmedwasconsistently
Falseeven after the bounded retry polling fix in v0.47.11.Root cause:
chrome.storage.onChangeddoes not reliably fire when storageis written via CDP
Runtime.callFunctionOn. The write succeeds (readback inStep 5 confirms the value), but the event never dispatches to the extension SW.
This means
startAlarmIfNeeded()inbackground.jsnever runs and theswKeepalivealarm is never created.Fix
Add Step 6 to
inject_storage_config_to_extensioninPydollEngine. Whenenable_sw_keepalive: Trueis in the config, explicitly callchrome.alarms.get("swKeepalive")+chrome.alarms.create(...)directly fromthe SW CDP session before detach. This bypasses
onChangedentirely — thealarm is created within the same CDP session that writes the config.
Tests
4 new unit tests in
TestPydollEngineInjectStorageConfigToExtension:test_alarm_reconciliation_called_when_enable_sw_keepalive_truetest_alarm_reconciliation_skipped_when_enable_sw_keepalive_falsetest_alarm_reconciliation_failure_raises_page_load_errortest_alarm_reconciliation_does_not_expose_secretsAll 111 unit tests pass.
Test plan
sw_keepalive_confirmed: PASS