Skip to content

fix: prevent UIPageViewController page curl crashes#498

Merged
everpcpc merged 3 commits intomainfrom
codex/fix-pagecurl-transition-crash
Feb 17, 2026
Merged

fix: prevent UIPageViewController page curl crashes#498
everpcpc merged 3 commits intomainfrom
codex/fix-pagecurl-transition-crash

Conversation

@everpcpc
Copy link
Copy Markdown
Owner

@everpcpc everpcpc commented Feb 17, 2026

Summary

  • harden DIVINA CurlPageView transition safety by tracking active page-curl transitions and syncing currentPageIndex from the visible controller before gesture and target navigation checks
  • block ambiguous low-velocity boundary pans in page-curl mode to avoid invalid neighbor resolution at first/last page
  • keep EPUB WebPubPageView controller reuse for smooth page turns, but add strict reuse guards (visible + pending + reserved) so controllers returned by before/after are not repurposed during the same transition
  • protect cache eviction with the same guard set to preserve preloaded controllers needed by in-flight transitions

Related Issue

Testing

  • make build-ios

Harden CurlPageView navigation by tracking active transitions and synchronizing the visible page index before handling gestures or programmatic navigation.

Remove cross-key controller reuse in WebPubPageView so each cache key maps to a stable view controller instance, avoiding invalid transition payloads in UIPageViewController.
Reintroduce cross-key controller reuse for WebPubPageView to avoid full WebView recreation on each page turn.

Protect reuse safety by reserving controllers returned by data source callbacks and excluding visible, pending, and reserved controllers from reuse and eviction to prevent invalid UIPageViewController transition payloads.
@everpcpc everpcpc merged commit 9f99ac3 into main Feb 17, 2026
3 checks passed
@everpcpc everpcpc deleted the codex/fix-pagecurl-transition-crash branch February 17, 2026 08:48
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.

[Bug] the first page of the first book attempts to go to the previous page and will crash directly.

1 participant