-
-
Notifications
You must be signed in to change notification settings - Fork 594
fix(android): crash while drawing in dispatchGetDisplayList
#3322
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
base: main
Are you sure you want to change the base?
fix(android): crash while drawing in dispatchGetDisplayList
#3322
Conversation
|
I am wondering if we are worried that animations could be delayed by one frame when using reanimated screens, but i am not sure if thats really a problem here? |
|
An alternative would be to shift the responsibility to either reanimated or rn-core to check to only mount if we are not drawing currently. |
ede6a0f to
e8ba8c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm rather reluctant to land this change in screens.
This is an event sent to JS asynchronously and meant to be consumed in JS.
The fact that reanimated could hijack it & run sync commit w/ mounting is reanimated implementation detail / operation model & I don't think this lib should rely / adjust to it, especially that likely this can be handled on the other side.
I'll talk this through with reanimated guys.
|
I totally agree with you @kkafar, just wanted to let you know this PR fixes the issue for me. But I'd also appreciate it if this could be solved on the Reanimated side. |
|
Initial conclusions are that we'll want to investigate it further, before we settle on any solution. Will be back once we have some decisions. |
|
@kkafar this patch fix the issue in the reanimated package: |
|
I'm doing something entirely different atm., but it has just crossed my mind that potentially posting the This makes me even more reluctant to land it. |
Description
Fixes #3321
Changes
The
applyTransformationcallback is called while we are drawing in android, as can be seen in this stack:The event we dispatch might be intercepted by reanimated which will cause to synchronously execute a mount transaction, which can alter the native view hierarchy, causing the mentioned issue.
The fix here is to move the dispatching off of the drawing stack, and post to the next queue spot.
I think
mFragment.viewis always present? If not we can also use something likeUIThreadUtilsif thats preferred.Test code and steps to reproduce
/
Checklist