New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash (Assertion failure) in Pageboy.PatchedPageViewController when swiping fast #277
Comments
I did some more research and it may have to do with the animations. |
@BasBuijsen yep I think this is unfortunately a well documented bug within Is this when interactively scrolling through dragging or triggering a page transition via a button interaction or similar? |
@msaps This happens when a user swipes multiple times and fast after each other through pages. So not by clicking buttons |
@msaps Sorry to keep bothering you but can you look into a solution or a workaround because this is very high on our priority list? |
@BasBuijsen I would love to solve it - however it isn't easily reproducible. Do you have a demo project/source code you can provide that showcases this issue? A quick look on Google/StackOverflow shows this popping up a lot with use of |
@msaps Thank you for your help! I will try to make a demo project for you since our app is closed source. I will get back to you as soon as possible (probably tomorrow). |
@msaps i had a quick look if i could fix it myself and quite surprisingly i have fixed it. However i cant push a new branch because i don't have access. Can you either help me to push the branch or implement the code i changed? As you can see i only added the isAnimating bool and check for it so it cannot start a new one when the previous is still happening. This fixed the crash for us. |
@BasBuijsen amazing to hear that fixed it! I've raised a PR with the changes (credited to you of course): #278. In future to contribute you just need to Fork the repo, commit your changes in your 'forked' repo and then create a PR into this one 🙂. Will release this as |
@msaps Thank you for your help and fast responses! Do you have any idea when the new version will be available? |
@BasBuijsen available now: 4.0.1 |
@msaps Thank you very much! Is there also a new version for Tabman that uses this version? If not can that be created? |
@BasBuijsen the latest version of Tabman (3.0.0) will support using Pageboy 4.0.1 - so just update the dependencies in whichever dependency manager you use 🙂 |
@BasBuijsen having looked further into this - I'm not sure how this would have solved the issue..
Can you reproduce the crash in the Pageboy example project / update it to potentially reproduce it? Would be really useful to reproduce the crash to try and fix it. |
@msaps i added logs in the project to check when the crash appeared and it happened when this method was called. The stacktrace also refers to this class wich only contains one method |
@msaps I didnt have time yet to test it with the demo project (i couldn't get the project working) but here are two videos of our apps with the bug and the change. In the first one i haven't changed anything and it is just version 4.0.1 of PageBoy. In the second video i made the same change as in my pr and as you can see the crash no longer appears and the animations are a lot nicer since they cannot start when a previous animation is still happening. |
@BasBuijsen okay I see - please check out the latest changes on Also out of interest - are you calling |
@msaps I tested the newest version of main but it sometimes still causes the crash. This seems to cause the crash: isAnimating = animated And this fixes it for me: isAnimating = true This is because the And yes we do call that function. |
@BasBuijsen With 06a4150 the blocking logic is now applied universally regardless of animation - and will prevent parallel attempts to Where are you calling |
@msaps Thank you! Yes it is used during pagination. We have an infinite swiping feature where every page requests the next one from the api and when it gets the response the |
@BasBuijsen now released 4.0.2 which has the latest changes in it 🙂 |
@msaps Great! thanks for all your help |
@msaps
We have 14 apps that are using pageboy as a dependency of Tabman and when we swipe about 10 pages fast after each other the app crashes with an Assertion failure. From the stacktrace we get an Assertion failure in Pageboy without any further specifications. We have a big userbase and it is currently causing a lot of crashes so a quick fix would be very helpful for us!
Our stacktrace:
`
2022-10-28 11:33:14.353745+0200 Groei[58716:22674120] *** Assertion failure in -[Pageboy.PatchedPageViewController queuingScrollView:didEndManualScroll:toRevealView:direction:animated:didFinish:didComplete:], UIPageViewController.m:2040
2022-10-28 11:33:14.357491+0200 Groei[58716:22674120] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'No view controller managing visible view <UIView: 0x131686a70; frame = (0 0; 390 844); autoresize = W+H; backgroundColor = <UIDynamicCatalogColor: 0x282618320; name = Primary/Background>; layer = <CALayer: 0x28013e460>>'
*** First throw call stack:
(0x1affea248 0x1a93afa68 0x1aa96e81c 0x1b290014c 0x1b290a164 0x1b290ba9c 0x1b290926c 0x1b290a35c 0x1b28fde3c 0x1b28fe000 0x10592ba20 0x10592bef4 0x10592549c 0x105925194 0x1059246e8 0x105924ad0 0x100d482ac 0x100d48a40 0x100d4a97c 0x100d4ad30 0x10950a048 0x10950a8ac 0x1094b8a34 0x10950cdb4 0x10950cfac 0x10952d880 0x109532874 0x109533fd8 0x109532954 0x10950bcfc 0x10950c7b8 0x1094fca2c 0x10950bfd8 0x10950cdb4 0x10950cfac 0x10952d880 0x1094df5b0 0x1094df640 0x1094b900c 0x1094b8c78 0x10952a0e4 0x100ad84e8 0x100ad88e4 0x101b2584c 0x1019ffd74 0x1019dd364 0x1019ff498 0x1019436a0 0x100ad8114 0x100ad7dec 0x100ad7f48 0x100ec82cc 0x101b2584c 0x1019ffd74 0x1019dd364 0x101b9e71c 0x101bc7ad4 0x101b9e2f0 0x101b50a84 0x101b510f8 0x101b5133c 0x101b4fcc8 0x101b72cdc 0x101b6275c 0x101b6230c 0x101b6a014 0x101b69938 0x101b71440 0x101c3c140 0x101be9130 0x101c42e10 0x101bf108c 0x101bf1144 0x101bf1250 0x101b72980 0x101b637d8 0x101b6296c 0x101b60d30 0x101b6a5f4 0x101b69fd8 0x101b69bc4 0x101b46794 0x1019dd638 0x101b9e664 0x101b9e9b8 0x101b9e28c 0x101b50a84 0x101b51e78 0x101b84bf0 0x101b79b58 0x101b789b8 0x101b8d2a4 0x101e071a8 0x101e099ec 0x1b1174968 0x1069a0598 0x1069a204c 0x1069b2800 0x1069b2344 0x1b007aa08 0x1b005c368 0x1b00611e4 0x1e8e81368 0x1b2510d88 0x1b25109ec 0x100af1780 0x1ce385948)
libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'No view controller managing visible view <UIView: 0x131686a70; frame = (0 0; 390 844); autoresize = W+H; backgroundColor = <UIDynamicCatalogColor: 0x282618320; name = Primary/Background>; layer = <CALayer: 0x28013e460>>'
terminating with uncaught exception of type NSException
`
When anything more is needed you can let us know.
The text was updated successfully, but these errors were encountered: