Skip to content

fix: delete a revoked license so an offline launch can't unlock it - #50

Merged
TobbenTM merged 2 commits into
mainfrom
la-paz/moonbase-c-handover
Nov 2, 2026
Merged

TobbenTM merged 2 commits into
mainfrom
la-paz/moonbase-c-handover

Conversation

@TobbenTM

@TobbenTM TobbenTM commented Nov 2, 2026

Copy link
Copy Markdown
Member

A license Moonbase refused stayed on disk, so a launch without a connection fell back on it within onlineGracePeriod and unlocked a revoked or refunded license, or a revoked activation, until the grace period ran out. A LicenseRevoked or LicenseActivationRevoked answer now throws license_revoked_error (a license_invalid_error with the same type(), plus activation_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 on license_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).

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).
@argos-ci

argos-ci Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Nov 2, 2026, 12:34 PM

@TobbenTM
TobbenTM merged commit eda1bee into main Nov 2, 2026
20 checks passed
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))
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 4.13.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant