Repository navigation
Keep cloud reporting on when the cached API status is missing + 2.17.3 - #176
Merged
Merged
Conversation
is_premium() read only a cached status, and nothing re-checked the key once that cache was gone: is_api_active() had no callers. The cache is cleared on every settings save and expires after 12 hours, so a connected site silently stopped sending detections at the first save or within 12 hours of connecting. A missing status now counts as unknown, keeps cloud features on, and schedules a background re-check that sets it to active or inactive.
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.
Connected sites stop sending detections to WebDecoy Cloud shortly after they connect.
is_premium()reads only the cachedwebdecoy_api_statustransient. Connecting sets it toactive, but the cache is cleared on every save ofwebdecoy_optionsand expires after 12 hours, and nothing ever refills it:is_api_active(), the only re-check, has no callers. From then on detections, the test trigger and violation reports are all skipped, even though the test trigger still returns its "recorded" receipt.webdecoy_check_api_statuscron that re-validates the key and cachesactiveorinactive.inactive) or a recent network error (error, 5 minutes) turns cloud features off.WebDecoy_Cloud_Connect::status_allows_cloud(), unit-tested. A source test asserts that the re-check is scheduled and wired; it fails when the fix is reverted.Needs a release to reach installed sites.