Repository navigation
Keep the license code when the server rejects it - #20
Merged
Merged
Conversation
invalid_license is returned for any unmatched code/product pair — a site pointed at the wrong product, a license row removed by mistake — not only for a revoked license. Enforcement is server-side either way, so deleting the customer's only copy of the code achieved nothing while turning a recoverable state into a support round-trip. - Mark stored license data status: invalid instead of deleting, keeping renewal_url and the rest intact - Leave a previously working license untouched when a newly submitted key is rejected; the submitted key is only stored once it verifies, so the failure path was deleting the old one and storing nothing - Keep the deliberate empty-field deactivation as the one path that still deletes - Explain an unrecognised key on the admin panel rather than reporting a missing upgrade package Refs #19 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
5 tasks done
# Conflicts: # CHANGELOG.md
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 #19
Summary
invalid_licenseis returned by the server for any unmatchedcode+product_idpair — a site pointed at the wrong product, a license row removed by mistake, a product recreated — not only for a genuinely revoked license. Enforcement is server-side regardless (UpdatesControllerblanks thepackageURL,DownloadController404s), so deleting the customer's only copy of the key achieved nothing while turning a recoverable state into a support round-trip.Tracker::sync_license_data()andAdmin::handle_sync()now call the newIntegration::mark_license_invalid(), which setsstatus: invalidon the stored data and preserves everything else — notablyrenewal_url, so the panel can still offer a renewal link.Admin::handle_save()no longer touches the stored license when a submitted key is rejected. The submitted key is only written in the success branch (src/Admin.php:203), so the old failure path deleted the working key and stored nothing — one typo, or one server blip, and the site was left with no license at all.src/Admin.php:171) is unchanged — that is a user asking to remove their license.Outage handling was already correct and is untouched: a 502 decodes to
wprepo_api_fail, a timeout tohttp_request_failed, a deactivated repo plugin torest_no_route, and the sales-channel providers returnwprepo_api_erroron upstream failure. None reach this branch.Test plan
invalid_licensemarks data invalid and keeps the code (TrackerSyncLicenseTest)mark_license_invalid()preservesrenewal_url/buyer_email, works with no stored data, and never callsdelete_optionphpcsunchanged except one added short-array-syntax hit matching the file's existing styleNot included
Deferred per discussion: gating automatic clearing behind N consecutive failures. With deletion removed entirely there is nothing left to debounce.
🤖 Generated with Claude Code