Skip to content

Merge develop into fix-issue-579 - #893

Closed
mauricecarrier7 wants to merge 40 commits into
readium:fix-issue-579from
ThePalaceProject:merge/develop-into-fix-issue-579
Closed

Merge develop into fix-issue-579#893
mauricecarrier7 wants to merge 40 commits into
readium:fix-issue-579from
ThePalaceProject:merge/develop-into-fix-issue-579

Conversation

@mauricecarrier7

Copy link
Copy Markdown

Hi @mickael-menu — this brings fix-issue-579 up to date with develop so #880
can merge again. It adds no new behaviour — the only code changes are the ones
the conflicts forced, and they're listed below.

The branch is 39 commits behind develop and #880 currently shows as
conflicting. We ship your series in Palace (rebased onto 3.11.0), so we needed
this merge for ourselves anyway — sharing it in case it saves you the time.

What conflicted, and how it's resolved

Four files, all from the 4.0 concurrency work:

  • ZIPFoundationContainer — kept develop's @Sendable consume and native
    Task.isCancelled guard; your out-of-range clamp applied cleanly on top.
  • ReadError — kept both develop's Sendable conformance on AccessError
    and your isCancellation. They do different jobs: wrap(_:) normalises at the
    boundary, while isCancellation is a predicate over an existing error that
    also unwraps .decoding(...).
  • AudioNavigator — kept develop's timeObserverToken/notificationTask,
    which supersede the series' own timeObserver/playerItemEndObserver, and
    carried over the item-status and isPlaybackLikelyToKeepUp observers, which
    develop doesn't have. The class is @MainActor now and KVO callbacks arrive
    off it, so both handlers hop, and the publication/resourceIndex read moved
    inside the hop.
  • LCPDecryptor — took develop's file wholesale and re-applied the chunking
    around its arithmetic, so its ranged decryption is preserved byte-for-byte and
    only the chunking loop is new.

The net diff against develop is the same 12 files as #880 — the merge brings in
nothing else.

Verification

  • Full package suite, Xcode 26.4 / iOS 26 simulator: 1,536 tests, 0 failures.
  • Streaming confirmed end to end in our app against a real LCP audiobook, on our
    port of this series onto the 4.0.0-alpha.1 tag (which differs from develop
    by two commits, neither touching LCP): playback starts from the licence alone,
    with only the 2.5 KB .lcpl on disk and no .lcpa fetched. The same title on
    the same build with streaming switched off downloads the full 778 MB package
    first.

A couple of notes

Steven's getOrNil suggestion lands on a line this merge moved: the
readingOrder[resourceIndex] read now sits inside the @MainActor hop
(inside observe(currentItem:)). I left the behaviour alone so this stays a pure merge — happy
to apply it if you'd like it folded in.

Two of the patches have no test coverage — the resource caching in
PublicationMediaLoader, and the .loading state correction in
AudioNavigator. We checked by reverting each one: removing the caching patch
leaves all 1,534 remaining tests green. Tests/LCPTests also isn't a target in
Package.swift, so LCPDecryptionTests never runs. Happy to write tests for any
of these if it would help.

Thanks for the fix — it's the reason audiobook streaming works for our users.

mickael-menu and others added 30 commits July 15, 2026 12:06
stevenzeck and others added 10 commits August 7, 2026 17:47
Co-authored-by: Mickaël Menu <mickael.menu@gmail.com>
Brings the readium#579 series up to date with develop (39 commits), resolving the
four conflicts introduced by the 4.0 concurrency work.

- ZIPFoundationContainer: kept develop's @sendable consume + native
  Task.isCancelled guard; the out-of-range clamp merged cleanly on top.
- ReadError: kept both develop's Sendable conformance on AccessError and the
  series' isCancellation. wrap(_:) normalises at the boundary; isCancellation
  is a predicate over an existing error that also unwraps .decoding(...).
- AudioNavigator: kept develop's timeObserverToken/notificationTask, which
  supersede the series' own timeObserver/playerItemEndObserver, and carried
  the item-status and likely-to-keep-up observers, which develop lacks.
  AudioNavigator is @mainactor on develop and KVO callbacks arrive off it, so
  both handlers now hop, and the publication/resourceIndex read moved inside
  the hop.
- LCPDecryptor: took develop's file wholesale and re-applied the chunking
  around its arithmetic, so develop's ranged decryption is preserved
  byte-for-byte and only the chunking loop is new.
@mauricecarrier7
mauricecarrier7 deleted the merge/develop-into-fix-issue-579 branch September 9, 2026 18:07
@mickael-menu

Copy link
Copy Markdown
Member

FYI it's at the top of my list after an LCP CRL fix, I'll make sure it's merged in develop soon.

@mauricecarrier7

mauricecarrier7 commented Sep 9, 2026

Copy link
Copy Markdown
Author

FYI it's at the top of my list after an LCP CRL fix, I'll make sure it's merged in develop soon.

Thanks, good to know. No rush on our side; we're on the 3.11.0 rebase and unaffected until we move to the 4.0 line. Happy to re-test on develop once it's in.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants