Treat an empty AddOnLicenses result as a temporary reconciliation state—not proof that the lifetime entitlement was withdrawn—and retry GetAppLicenseAsync() before changing previously granted access.
What the documented behavior establishes
-
GetAppLicenseAsync()returns the current app license and its durable add-on licenses. When the device is offline, it explicitly returns the licenses cached on that device.^1^ -
StoreAppLicense.AddOnLicensescontains durable licenses that are currently valid and entitle the user to use the add-on. Invalid or expired licenses disappear from that collection.^2^ -
GetUserCollectionAsync()answers a different question: which add-ons of the current app the user has purchased. It returns product/collection information rather than the app’s current usable license view.^3^
Therefore, the earlier observation—collection contains the SKU while AddOnLicenses is empty—shows disagreement between purchased-product data and the current license view. The public documentation identifies offline caching as one condition that can produce an older license view, but it does not document:
- a propagation SLA after code redemption;
- a guaranteed maximum inconsistency interval;
- every condition under which a successful online call can omit an owned durable;
- a client API that identifies “stale device cache” versus “Store service has not propagated it yet.”
The observed 17 minutes is consequently not a documented refresh period.
Availability settings
Hidden + Stop acquisition does not prevent this redemption scenario. Under that setting, ordinary new purchases are stopped, but previous owners and customers with promotional codes on Windows 10 or Windows 11 may still acquire the add-on.^4^
The documentation describes these settings as acquisition and discoverability controls; it does not say that they suppress license delivery for a successfully redeemed entitlement. There is therefore no documented basis for attributing the temporary omission to those settings.
Event and retry policy
OfflineLicensesChanged is raised when the app’s license status changes, and its handler should call GetAppLicenseAsync() again.^5^ However, Microsoft does not specifically guarantee that an already-running app receives this event for a promotional code redeemed externally. Do not wait indefinitely for it.
A practical application policy, not a Microsoft SLA, is:
- Query at startup and resume.
- Subscribe to
OfflineLicensesChanged. - If the expected durable is absent but ownership was previously confirmed, show “Checking license” and preserve access temporarily.
- Retry immediately, then after 30 seconds, 2 minutes, and 10 minutes.
- Provide a Refresh license command that repeats the same check without opening a purchase UI.
- Serialize refreshes because startup, resume, the event, and manual refresh can race.
private readonly SemaphoreSlim gate = new(1, 1);
private async Task RefreshLicenseAsync()
{
if (!await gate.WaitAsync(0)) return;
try {
var license = await storeContext.GetAppLicenseAsync();
bool pro = license.AddOnLicenses.Values.Any(
x => x.SkuStoreId == expectedSku && x.IsActive);
await dispatcher.InvokeAsync(() =>
ApplyLicenseResult(pro)); // pending/grace policy is applied here
}
catch (Exception ex) {
Log($"GetAppLicenseAsync failed: 0x{ex.HResult:X8}");
await dispatcher.InvokeAsync(ShowLicensePending);
}
finally { gate.Release(); }
}
Keep the event subscription for the lifetime of the owning component and unsubscribe when it is disposed.
Granting and withdrawing access
For client-side feature enforcement, use the expected SKU’s presence in GetAppLicenseAsync().AddOnLicenses as the usable-license signal; that is the documented API for valid durable licenses.^6^
Use GetUserCollectionAsync(new[] { "Durable" }) diagnostically to determine whether Store collection data reports the purchase. Do not send an existing owner back through purchase merely because one license call is empty.
Because this case demonstrates that a valid lifetime license can be temporarily absent, do not revoke previously confirmed Pro access on one successful-but-empty response. Define a bounded reconciliation policy—for example, pending/grace through the retry sequence, followed by server validation or support escalation. Applications requiring strict fail-closed security can deny access earlier, but that is an application policy rather than documented proof that ownership ended.
For authoritative server-side validation, the Microsoft Store collection REST API can confirm whether a customer has an entitlement. It requires a service implementation and Microsoft identity platform authentication; it is not a drop-in client refresh mechanism.^7^
Diagnostics and escalation
Log both APIs in the same process and refresh cycle, including UTC timestamp, package identity/version, expected Store ID and SKU ID, online state, result counts, ExtendedError, exceptions/HRESULTs, Windows version, and Microsoft Store version. This makes the earlier separate-process result comparable without assuming that both processes observed the same cached state.
LicenseManager.RefreshLicensesAsync exists, but requires the restricted storeLicenseManagement capability; do not make it a general desktop-app workaround unless that capability is approved and declared.^8^
If an online mismatch persists through bounded retries, affects multiple customers, or is reproducible with aligned collection/license logs, open a Microsoft Partner Center support request for Store add-on/licensing or submission support. Include timestamps, product and SKU Store IDs, package identity/version, Windows and Store versions, HRESULTs or correlation details, and anonymized reproduction data. Only Microsoft support can determine whether a particular successful-but-incomplete response resulted from device-side license state or Store-service propagation.
References
- StoreContext.GetAppLicenseAsync Method-Definition
- StoreAppLicense.AddOnLicenses Property-Definition
- StoreContext.GetUserCollectionAsync (IIterable<String>) Method (Windows.Services.Store) - Windows apps | Microsoft Learn
- Set visibility options
- StoreContext.OfflineLicensesChanged Event-Definition
- Get license info for apps and add-ons
- In-app purchases and trials
- LicenseManager.RefreshLicensesAsync(LicenseRefreshOption) Method-Definition