Skip to content

fix(feedback): Disable native driver for backgroundColor animation #4794

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

Merged
merged 6 commits into from
May 1, 2025

Conversation

antonis
Copy link
Collaborator

@antonis antonis commented Apr 30, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Disable native driver for backgroundColor animation

💡 Motivation and Context

The 'backgroundColor' is not supported by native animations and causing a crash in older RN versions.

Android crash logs

Error: Style property 'backgroundColor' is not supported by native animated module

This error is located at:
    in c
    in f
    in RCTView
    in Unknown
    in __Sentry.TouchEventBoundary
    in Unknown
    in RCTView
    in Unknown
    in RCTView
    in Unknown
    in u
Error: Style property 'backgroundColor' is not supported by native animated module

This error is located at:
    in c
    in f
    in RCTView
    in Unknown
    in __Sentry.TouchEventBoundary
    in Unknown
    in RCTView
    in Unknown
    in RCTView
    in Unknown
    in u, stack:
validateStyles@221:4389
value@250:2140
value@226:2615
value@249:2877
value@226:2615
value@249:2274
value@249:1839
value@225:1674
value@250:1925
value@225:1674
value@224:3074
value@225:1674
value@241:639
r@242:1432
value@242:1611
value@220:2510
s@230:1060
start@230:1119
<unknown>@230:2366
forEach@-1
start@230:2247
value@736:3755
zl@59:65656
Va@59:81394
Va@-1
<unknown>@189:3836
Ha@59:79751
Ia@59:75906
Ia@-1
<unknown>@59:26275
<unknown>@189:3836
ht@59:26222
pt@59:26157
Ee@59:93057
Te@59:13008
Ce@59:13397
receiveTouches@59:14183
value@40:3537
<unknown>@40:730
value@40:2527
value@40:702
value@-1
Creating new dialog from context: com.rndiffapp.MainActivity@81c704c@136081484
FATAL EXCEPTION: main (Ask Gemini)
Process: com.rndiffapp, PID: 6044
com.facebook.react.bridge.JSApplicationIllegalArgumentException: disconnectAnimatedNodeFromView: Animated node with tag [6] does not exist
	at com.facebook.react.animated.NativeAnimatedNodesManager.disconnectAnimatedNodeFromView(NativeAnimatedNodesManager.java:411)
	at com.facebook.react.animated.NativeAnimatedModule$18.execute(NativeAnimatedModule.java:772)
	at com.facebook.react.animated.NativeAnimatedModule.executeAllOperations(NativeAnimatedModule.java:258)
	at com.facebook.react.animated.NativeAnimatedModule.access$400(NativeAnimatedModule.java:85)
	at com.facebook.react.animated.NativeAnimatedModule$3.execute(NativeAnimatedModule.java:287)
	at com.facebook.react.uimanager.UIViewOperationQueue$UIBlockOperation.execute(UIViewOperationQueue.java:579)
	at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:914)
	at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1025)
	at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(UIViewOperationQueue.java:47)
	at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1085)
	at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
	at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
	at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1229)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
	at android.view.Choreographer.doCallbacks(Choreographer.java:899)
	at android.view.Choreographer.doFrame(Choreographer.java:827)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7872)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
No tap action can be set up
failed to get buffer, invalid process token
Failed to transact (-32)
No tap action can be set up

💚 How did you test it?

Manual, CI E2E tests via #4604

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

Copy link
Contributor

github-actions bot commented Apr 30, 2025

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 387.10 ms 392.78 ms 5.68 ms
Size 7.15 MiB 8.40 MiB 1.25 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
3853f43+dirty 278.12 ms 338.72 ms 60.60 ms
ea85ff8+dirty 409.16 ms 402.47 ms -6.70 ms
86d6d2c+dirty 267.21 ms 325.24 ms 58.04 ms
80e955a+dirty 399.50 ms 453.16 ms 53.66 ms
30189be+dirty 362.02 ms 386.80 ms 24.78 ms
4cc5c27+dirty 398.36 ms 452.50 ms 54.14 ms
9c48b2c+dirty 270.82 ms 321.12 ms 50.30 ms
baa882f+dirty 449.30 ms 540.40 ms 91.10 ms
77680ec+dirty 393.50 ms 426.68 ms 33.18 ms
ed3d77e+dirty 366.04 ms 411.33 ms 45.28 ms

App size

Revision Plain With Sentry Diff
3853f43+dirty 7.15 MiB 8.08 MiB 959.34 KiB
ea85ff8+dirty 7.15 MiB 8.39 MiB 1.23 MiB
86d6d2c+dirty 7.15 MiB 8.09 MiB 962.69 KiB
80e955a+dirty 7.15 MiB 8.38 MiB 1.23 MiB
30189be+dirty 7.15 MiB 8.38 MiB 1.23 MiB
4cc5c27+dirty 7.15 MiB 8.22 MiB 1.07 MiB
9c48b2c+dirty 7.15 MiB 8.07 MiB 947.16 KiB
baa882f+dirty 7.15 MiB 8.34 MiB 1.19 MiB
77680ec+dirty 7.15 MiB 8.35 MiB 1.20 MiB
ed3d77e+dirty 7.15 MiB 8.35 MiB 1.21 MiB

Previous results on branch: antonis/fix-feedback-animation

Startup times

Revision Plain With Sentry Diff
bbe8793+dirty 396.74 ms 396.96 ms 0.21 ms
040c8c2+dirty 402.09 ms 415.16 ms 13.07 ms

App size

Revision Plain With Sentry Diff
bbe8793+dirty 7.15 MiB 8.40 MiB 1.25 MiB
040c8c2+dirty 7.15 MiB 8.40 MiB 1.25 MiB

Copy link
Contributor

github-actions bot commented Apr 30, 2025

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1226.16 ms 1220.43 ms -5.73 ms
Size 3.19 MiB 4.35 MiB 1.16 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
de59d3a+dirty 1241.17 ms 1249.16 ms 8.00 ms
5446992+dirty 1249.94 ms 1254.80 ms 4.86 ms
8ab11b6+dirty 1222.91 ms 1216.08 ms -6.83 ms
0eacc98+dirty 1223.85 ms 1233.12 ms 9.27 ms
8ae23a7+dirty 1233.67 ms 1229.52 ms -4.15 ms
52c0562+dirty 1233.94 ms 1226.29 ms -7.65 ms
83f6f6c+dirty 1232.02 ms 1229.15 ms -2.87 ms
2bf5613+dirty 1220.71 ms 1220.13 ms -0.59 ms
b6f8ea2+dirty 1254.10 ms 1236.67 ms -17.43 ms
30189be+dirty 1228.73 ms 1219.06 ms -9.67 ms

App size

Revision Plain With Sentry Diff
de59d3a+dirty 2.92 MiB 3.67 MiB 772.59 KiB
5446992+dirty 2.92 MiB 3.44 MiB 535.26 KiB
8ab11b6+dirty 2.92 MiB 3.67 MiB 772.38 KiB
0eacc98+dirty 3.19 MiB 4.25 MiB 1.07 MiB
8ae23a7+dirty 2.92 MiB 3.66 MiB 757.67 KiB
52c0562+dirty 2.92 MiB 3.69 MiB 794.15 KiB
83f6f6c+dirty 2.92 MiB 3.67 MiB 772.37 KiB
2bf5613+dirty 3.19 MiB 4.35 MiB 1.16 MiB
b6f8ea2+dirty 3.19 MiB 4.25 MiB 1.06 MiB
30189be+dirty 3.19 MiB 4.26 MiB 1.08 MiB

Previous results on branch: antonis/fix-feedback-animation

Startup times

Revision Plain With Sentry Diff
bbe8793+dirty 1234.57 ms 1240.65 ms 6.08 ms
040c8c2+dirty 1227.65 ms 1233.98 ms 6.33 ms

App size

Revision Plain With Sentry Diff
bbe8793+dirty 3.19 MiB 4.35 MiB 1.16 MiB
040c8c2+dirty 3.19 MiB 4.35 MiB 1.16 MiB

Copy link
Contributor

github-actions bot commented Apr 30, 2025

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 411.90 ms 411.87 ms -0.02 ms
Size 17.75 MiB 20.13 MiB 2.38 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d997097 470.23 ms 475.46 ms 5.23 ms
75774ea 454.16 ms 467.80 ms 13.64 ms
7bc4d75 488.76 ms 473.28 ms -15.48 ms
79976dd 456.94 ms 439.17 ms -17.76 ms
728164b 414.34 ms 449.22 ms 34.88 ms
60ad48c 430.73 ms 432.85 ms 2.12 ms
d0bf494+dirty 375.37 ms 395.14 ms 19.77 ms
e5c9b8b 409.02 ms 426.66 ms 17.64 ms
7301787 412.13 ms 405.46 ms -6.67 ms
2bf5613 425.56 ms 423.26 ms -2.31 ms

App size

Revision Plain With Sentry Diff
d997097 17.75 MiB 20.11 MiB 2.36 MiB
75774ea 17.74 MiB 20.08 MiB 2.35 MiB
7bc4d75 17.74 MiB 20.08 MiB 2.34 MiB
79976dd 17.75 MiB 20.11 MiB 2.36 MiB
728164b 17.73 MiB 19.85 MiB 2.12 MiB
60ad48c 17.75 MiB 20.12 MiB 2.37 MiB
d0bf494+dirty 17.73 MiB 19.75 MiB 2.02 MiB
e5c9b8b 17.73 MiB 19.83 MiB 2.10 MiB
7301787 17.75 MiB 20.13 MiB 2.38 MiB
2bf5613 17.75 MiB 20.13 MiB 2.38 MiB

Previous results on branch: antonis/fix-feedback-animation

Startup times

Revision Plain With Sentry Diff
040c8c2 449.52 ms 432.27 ms -17.25 ms

App size

Revision Plain With Sentry Diff
040c8c2 17.75 MiB 20.13 MiB 2.38 MiB

@antonis antonis marked this pull request as ready for review April 30, 2025 13:59
Copy link
Contributor

github-actions bot commented Apr 30, 2025

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1225.27 ms 1240.82 ms 15.55 ms
Size 2.63 MiB 3.78 MiB 1.15 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
de59d3a+dirty 1223.73 ms 1236.28 ms 12.55 ms
5446992+dirty 1273.28 ms 1276.68 ms 3.40 ms
8ab11b6+dirty 1203.23 ms 1206.02 ms 2.79 ms
0eacc98+dirty 1232.69 ms 1234.67 ms 1.97 ms
8ae23a7+dirty 1230.02 ms 1227.62 ms -2.40 ms
52c0562+dirty 1219.34 ms 1221.25 ms 1.91 ms
83f6f6c+dirty 1218.33 ms 1220.27 ms 1.93 ms
2bf5613+dirty 1242.29 ms 1247.98 ms 5.69 ms
b6f8ea2+dirty 1236.08 ms 1228.58 ms -7.50 ms
30189be+dirty 1205.04 ms 1226.73 ms 21.69 ms

App size

Revision Plain With Sentry Diff
de59d3a+dirty 2.36 MiB 3.11 MiB 760.16 KiB
5446992+dirty 2.36 MiB 2.88 MiB 531.94 KiB
8ab11b6+dirty 2.36 MiB 3.11 MiB 759.83 KiB
0eacc98+dirty 2.63 MiB 3.69 MiB 1.05 MiB
8ae23a7+dirty 2.36 MiB 3.10 MiB 752.42 KiB
52c0562+dirty 2.36 MiB 3.14 MiB 793.36 KiB
83f6f6c+dirty 2.36 MiB 3.10 MiB 759.79 KiB
2bf5613+dirty 2.63 MiB 3.78 MiB 1.15 MiB
b6f8ea2+dirty 2.63 MiB 3.68 MiB 1.05 MiB
30189be+dirty 2.63 MiB 3.70 MiB 1.06 MiB

Previous results on branch: antonis/fix-feedback-animation

Startup times

Revision Plain With Sentry Diff
bbe8793+dirty 1217.65 ms 1222.02 ms 4.37 ms
040c8c2+dirty 1224.08 ms 1223.17 ms -0.91 ms

App size

Revision Plain With Sentry Diff
bbe8793+dirty 2.63 MiB 3.78 MiB 1.15 MiB
040c8c2+dirty 2.63 MiB 3.78 MiB 1.15 MiB

@krystofwoldrich
Copy link
Member

The change look good, but before approving I have questions about performance and related to the possible enabling the native driver since specific RN version where it was added (I quickly checked the RN changelog, but haven't seen any information about backgroundColor specifically).

I just want to make sure we are not hurting animation performance in new RN versions.

@krystofwoldrich
Copy link
Member

I've checked the git history the backgroundColor support was added in 0.69.0.

facebook/react-native@201f355

@antonis
Copy link
Collaborator Author

antonis commented Apr 30, 2025

I've checked the git history the backgroundColor support was added in 0.69.0.
facebook/react-native@201f355

Thank you @krystofwoldrich. I was looking for this 🙇

@antonis
Copy link
Collaborator Author

antonis commented Apr 30, 2025

I just want to make sure we are not hurting animation performance in new RN versions.

Good point @krystofwoldrich 👍
I haven't noticed a performance difference but it makes sense to handle this. I've added a check with b05cb43 to use native drivers in supported versions

Copy link
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a small comment, after resolving it, LGTM!

Co-authored-by: LucasZF <[email protected]>
@antonis antonis enabled auto-merge (squash) May 1, 2025 03:51
@antonis antonis merged commit 366c2d0 into main May 1, 2025
61 of 62 checks passed
@antonis antonis deleted the antonis/fix-feedback-animation branch May 1, 2025 03:52
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.

3 participants