Describe the bug
Calling lcpService.retrieveLicense for an asset with expired license returns Try.failure(LcpError.LicenseStatus.Expired).
This results in not being able to renew such a license to continue consuming the publication.
In swift-toolkit 3.7.0 the same function always obtains the license successfully, even if it has expired.
Thanks to it, the license can be renewed.
How to reproduce?
Call lcpService.retrieveLicense with an asset having an expired license. (rights.end < now).
It can be an lcpl file, or an lcpa that had a license injected before it expired.
Readium version
3.1.2
Android API version
API 36
Additional context
After some digging, I guess the issue is in line 349 of LicensesService file:
documents.getContext() throws an exception if anything during license validation failed. Because of that, the License object is not created.
swift-toolkit 3.7.0 doesn't have such check before creating the License object in its LicensesService, that's why it returns the current license from retrieveLicense function, even if it's expired.
Probably for the same reason, calling publication.lcpLicense after trying to open the publication with expired license with PublicationOpener returns null on Android, while on iOS it returns its current (expired) license.
Android:

iOS:

Describe the bug
Calling
lcpService.retrieveLicensefor an asset with expired license returnsTry.failure(LcpError.LicenseStatus.Expired).This results in not being able to renew such a license to continue consuming the publication.
In
swift-toolkit 3.7.0the same function always obtains the license successfully, even if it has expired.Thanks to it, the license can be renewed.
How to reproduce?
Call
lcpService.retrieveLicensewith an asset having an expired license. (rights.end< now).It can be an
lcplfile, or anlcpathat had a license injected before it expired.Readium version
3.1.2
Android API version
API 36
Additional context
After some digging, I guess the issue is in line 349 of
LicensesServicefile:documents.getContext()throws an exception if anything during license validation failed. Because of that, theLicenseobject is not created.swift-toolkit 3.7.0doesn't have such check before creating theLicenseobject in itsLicensesService, that's why it returns the current license fromretrieveLicensefunction, even if it's expired.Probably for the same reason, calling
publication.lcpLicenseafter trying to open the publication with expired license withPublicationOpenerreturnsnullon Android, while on iOS it returns its current (expired) license.Android:

iOS: