Repository navigation
fix: delete a revoked license so an offline launch can't unlock it - #50
Merged
Merged
Conversation
When Moonbase refused a license at launch or on re-validation, the JUCE controller locked but kept the license file, so that the next launch could check it again. A refusal stores nothing, though, so the file kept the time of its last successful check, and a launch without a connection fell back on it within onlineGracePeriod. A revoked or refunded license, or a revoked activation, stayed locked online and unlocked offline until the grace period ran out. Moonbase answers LicenseRevoked or LicenseActivationRevoked for those, and neither comes back without activating again. Both now throw license_revoked_error, a license_invalid_error whose type() is unchanged and whose activation_revoked() says which was revoked. The controller deletes the stored license on it, at launch and on re-validation, and still locks with LockReason::Invalid. It deletes only the refused copy of that license and activation, never one issued after it: activating the same computer again keeps its activation id, so matching on the id alone could remove a license another instance had just activated. The bridge example does the same. Other refusals keep the file as before. A lapsed subscription (LicenseExpired) validates again once it is renewed, and a 400 without a revoked code, LicenseInvalid included, can be about the request or the app's setup rather than the license. The core SDK guide no longer suggests deleting the license on every license_invalid_error. Tested with new controller tests: a license revoked at launch or on re-validation stays locked on an offline relaunch within the grace period (both fail without the fix), the other refusals keep the file, and an activation of the same computer that lands while the refusal is on its way is kept. The core and JUCE suites pass on macOS (213 and 170 cases).
…the message thread The revoked-license cleanup deleted a stored copy validated at the same time as the refused one. Validation times are whole seconds, and an add-on call keeps the previous validation's, so an equal time doesn't make it the refused copy: activating the same computer again within that second kept the activation id and would have been deleted. Only the refused token itself, or an older copy, is deleted now. It also waited for the store's lock on the message thread, which another process can hold for a whole request, freezing the host's UI meanwhile. At launch the delete now runs on the start() worker, while the license watch is still waiting for the launch to settle. On re-validation it is queued on a worker after the controller has locked, so the watch doesn't take the removal for another instance's. A diagnostic says whether the file was removed or kept. The bridge example uses the same rule. New tests: an activation validated in the same second as the refused copy is kept, and the refresh answers and locks while another process holds the lock, removing the file once it is free. Both fail against the previous behaviour. The core and JUCE suites pass on macOS (213 and 171 cases).
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
github-actions Bot
pushed a commit
that referenced
this pull request
Nov 2, 2026
## [4.13.3](v4.13.2...v4.13.3) (2026-11-02) ### Bug Fixes * delete a revoked license so an offline launch can't unlock it ([#50](#50)) ([eda1bee](eda1bee))
|
🎉 This PR is included in version 4.13.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
A license Moonbase refused stayed on disk, so a launch without a connection fell back on it within
onlineGracePeriodand unlocked a revoked or refunded license, or a revoked activation, until the grace period ran out. ALicenseRevokedorLicenseActivationRevokedanswer now throwslicense_revoked_error(alicense_invalid_errorwith the sametype(), plusactivation_revoked()), and the JUCE controller and the bridge example delete the stored license on it at launch and on re-validation, while every other refusal keeps the file as before. The delete runs off the message thread and removes only the refused copy or an older one of the same license and activation, since activating the same computer again keeps its activation id; the core SDK guide now recommends deleting only onlicense_revoked_error, and the module and bridge docs describe the new behaviour. New controller tests (an offline relaunch after a revoke stays locked, other refusals keep the file, a re-activation of the same computer survives, the store lock doesn't hold up the message thread) fail against the old behaviour, and the core and JUCE suites pass on macOS (213 and 171 cases).