Premium license gets reset when failing to resolve license server domain
Environment
- OS version: Ubuntu 22.04
- Browser version: Chrome 120
- Extension version: Adblock Plus 3.22
- Last working version: TBD
Steps to reproduce
- Activate Premium.
- Run license check.
- Change domain in "premium_license_check_url" to one that doesn't exist (e.g. "https://myadblock.licensing.adblockplusssssssssssssssssssssss.dev/license").
- Run license check.
Observed behavior
- After 1) License check succeeds.
- After 2) License check succeeds.
- After 4) License check fails with "ERR_NAME_NOT_RESOLVED" and license gets deactivated.
See also user reports at https://app.asana.com/0/1204875085681082/1205470132352096/f
Expected behavior
- After 1) License check succeeds.
- After 2) License check succeeds.
- After 4) License check fails with "ERR_NAME_NOT_RESOLVED" and license remains activated. Subsequently, further attempts are made and license gets deactivated after the third attempt.
What to change
Spec: spec!434 (merged)
Adopt AdBlock's approach for performing Premium license checks: Ignore both permanent and temporary license check errors, thereby allowing unlimited retries and only deactivating a user's Premium license when the license server instructs the extension to do so by telling it that the user's license has expired.
Further information
When encountering problems with the license check, we differentiate between temporary and permanent problems. License checks will be retried when encountering temporary problems, before the license gets deactivated, whereas that happens immediately when encountering a permanent one. For example, being offline is a expected to be a temporary problem, but the server telling us that the license check endpoint doesn't exist (i.e. responding with HTTP 404) is considered a permanent one.
The browser failing to resolve the domain name of the license server is currently handled as a permanent problem. As some user reports have shown, however, it appears to be quite common. Considering that such DNS problems can be temporary, it could therefore make sense to treat them as temporary to retry the license checks before deactivating the license.
Additionally, comparing the license check logic to AdBlock's, where such user reports are much less frequent, there it doesn't differentiate between temporary or permanent problems and always attempts to retry license checks. Therefore we could, at least for unknown errors, change the default to always attempt to retry failing license checks.
Hints for Testers
- The only way to deactivate a premium license is that the server sends a response with a non-active license status or an invalid license version number (different than
1
). Any other response, including server errors or connection errors, should make the extension re-check every minute for a maximum of 3 times, keeping the current premium license if the server doesn't instruct to deactivate it. - We need to update the documentation for the ABP License Server Mock after merging these ticket changes