I noticed a non deterministic bug when streaming a ZIP package from the shared storage. Sometimes we can't read a resource which fails with:
ZipException: invalid code lengths set
java.util.zip.InflaterInputStream.read(InflaterInputStream.java:184)
How to reproduce?
Import BellaOriginal3.epub.zip in the Test App using "Read from shared storage" instead of "Import to app storage".
Open the book.
Close it and then try to reopen it right away. Do so until you observe a blank page and the following in the logs:
16:12:22.518 E </head> closing tag not found in resource with href: null
16:12:22.519 E </head> closing tag not found in resource with href: null
16:12:22.588 D app_time_stats: avg=236.79ms min=14.65ms max=1976.69ms count=9
16:12:22.600 E UserError: Publication looks corrupted.
ReadError.Decoding: An error occurred while attempting to decode the content.
EOFException:
org.readium.r2.shared.util.zip.compress.utils.IOUtils.readFully(IOUtils.java:239)
org.readium.r2.shared.util.zip.compress.archivers.zip.ZipFile.setDataOffset(ZipFile.java:1275)
16:12:22.608 E UserError: Publication looks corrupted.
ReadError.Decoding: An error occurred while attempting to decode the content.
ZipException: invalid code lengths set
java.util.zip.InflaterInputStream.read(InflaterInputStream.java:184)
org.readium.r2.shared.util.zip.compress.archivers.zip.InflaterInputStreamWithStatistics.read(InflaterInputStreamWithStatistics.java:83)
Describe the bug
I noticed a non deterministic bug when streaming a ZIP package from the shared storage. Sometimes we can't read a resource which fails with:
How to reproduce?
https://github.com/readium/kotlin-toolkit/assets/58686775/52429ad0-202d-4abd-a7c7-319feb321b3e
Readium version
develop
Android API version
34
Additional context
No response