fix(ios): prevent PagerView crash on duplicate states in queue#10247
Closed
huhuanming wants to merge 2 commits intoxfrom
Closed
fix(ios): prevent PagerView crash on duplicate states in queue#10247huhuanming wants to merge 2 commits intoxfrom
huhuanming wants to merge 2 commits intoxfrom
Conversation
Add transitioning guard in setPagerViewControllers to prevent calling setViewControllers while a previous animated transition is in progress. UIPageViewController's internal _UIQueuingScrollView does not support concurrent enqueued transitions and crashes with "Duplicate states in queue" (NSInternalInconsistencyException). Also removes accidentally included android/build/ artifacts from the patch. Analyzed from Sentry crash report: 6f5ce7dc764d49189bed67414df232e4
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Duplicate states in queue导致的致命崩溃setPagerViewControllers方法中增加transitioning状态守卫,防止在上一次动画过渡未完成时重复调用setViewControllersandroid/build/构建产物Root Cause
UIPageViewController内部的_UIQueuingScrollView不支持并发的入队过渡。当用户快速切换 tab 或程序化页面同步与用户操作重叠时,两次setViewControllers:direction:animated:completion:调用会导致队列中出现重复状态,触发NSInternalInconsistencyException断言崩溃。现有 patch 已有 recycling、nil、边界检查等守卫,但缺少对
transitioning状态的检查。Fix
Test plan
Sentry Event:
6f5ce7dc764d49189bed67414df232e4🤖 Generated with Claude Code