fix(audiobook): reconcile app to toolkit TOC collapse (Findaway dual chapter-numbering)#1083
Conversation
…numbering) Pairs with ThePalaceProject/ios-audiobooktoolkit#184. Bumps the toolkit submodule to the TOC-collapse fix (one chapter per physical track for oversubdivided/dense manifests) and makes the app consume that single collapsed list. - Submodule ios-audiobooktoolkit 28de55a -> e289f790 (PR1 #184 merged main). - AudiobookSessionManager.normalizedChapters(for:) -> passthrough (return toc.toc). The toolkit now owns TOC collapse, so the SECOND collapse implementation in the app — which diverged from the toolkit and produced the Findaway "Dune" dual chapter-numbering (toolkit used the uncollapsed list for currentChapter / NowPlaying / saved-position while the app displayed the collapsed one) — is removed. Single source of truth. - New app test FindawaySavedVsPlayedTests + dune_oversubdivided_manifest fixture: asserts the saved-vs-played invariant from the device log (a bookmark on physical track findaway:1:3 @34.757 saves to 1:3, not 1:4, and round-trips back). No build-number bump (release gate active — no new TestFlight build). Mutation: no mutation evidence — pure-refactor. normalizedChapters(for:) is now a one-line passthrough (return toc.toc) with no mutable branches; the collapse logic moved to the toolkit and is behavior-covered by toolkit FindawayOversubdividedTOCTests (Dune->3, DCC->7, martian element-identical, no-op) + the new app FindawaySavedVsPlayedTests. Not done: does not change the player/engine, position-save format, Manifest decoder, or TrackPosition/toAudioBookmark. ChapterTOCNormalizer / normalizedChaptersCount are retained as the unit-tested threshold spec (now implemented in the toolkit); only the app's production collapse path is removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🏗️ CodeAtlas Ledger Analysis✅ All Checks Passed♿ Accessibility (via AccessLint)
✅ No accessibility issues detected 🧪 Test Coverage (via QAAtlas)
🏛️ Architecture Analysis
🔍 Reachability Analysis
✅ No dead code detected 📊 0 files analyzed | 📦 Download Full Report Powered by CodeAtlas Ledger |
🧪 Unit Test Results📊 View Full Interactive Report ✅ ALL TESTS PASSED7206 tests | 7097 passed | 0 failed | 109 skipped | ⏱️ 13m 37s | 📊 98.5% | 📈 47.3% coverage Tests by Class — 827 classes (click to expand)
📊 Testing Coverage BreakdownUnit Test Line Coverage (testable surfaces): 47.3% Total coverage incl. UI/lifecycle: 45.4% (18 files excluded from testable denominator — see
🔗 Interactive HTML Report | CI Run Details 📦 Downloadable Artifacts
|
Findaway audiobook dual chapter-numbering — app reconcile (PR2 of 2)
Fixes a 3.2.0 regression on oversubdivided Findaway/Bibliotheca audiobooks (e.g. "Dune", Findaway 32884): skipping across a chapter boundary did not change the displayed chapter, and the saved position key (
findaway:1:4) disagreed with the played track (1:3).Root cause: the manifest has literal duplicate
(part,sequence)keys (multiple TOC chapters → one physical track). 3.2.0 added an app-side TOC collapse but the toolkit (currentChapter/NowPlaying/saved-position) still used the full TOC → dual numbering.Fix (two PRs):
ios-audiobooktoolkit#184, merged → submodulee289f790): collapse the TOC to one chapter per distinct physicaltrack.key(keep-first; offset-distinctness discriminator preserves distinct-offset chapters like Dungeon Crawler Carl; dense-TOC 1.5× threshold moved into the toolkit). Single source of truth.AudiobookSessionManager.normalizedChaptersa passthrough that consumes the toolkit's already-collapsed TOC (removes the app's separate collapse) + addsFindawaySavedVsPlayedTests(saved key == played track, round-trips1:3).Verification: toolkit suite 8/8 (Dune→3, DCC preserved→7, the_martian element-identical swap-guard, normal no-op, keep-first, saved==played); app
FindawaySavedVsPlayedTestsgreen against the merged toolkit. SoD: architect + QA on a different model + independent toolkit-code architect review + coordinator clean-DerivedData re-verify.Known limitation (separate, upstream): the Bibliotheca manifest for 32884 is itself mis-keyed (the real Ch2 audio lives in a never-referenced
1:2file) — not client-fixable; tracked separately. Fixture-validity follow-up: PP-4580.