-
Notifications
You must be signed in to change notification settings - Fork 541
fix(🐎): fix Reanimated ArrayBuffer unmarshalling #3384
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
Conversation
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.
Pull Request Overview
This PR fixes an issue with Reanimated ArrayBuffer unmarshalling in the Skia package by adding an alternative property access method for color values. The fix addresses issue #3275 by providing a fallback mechanism when the object doesn't behave as a regular array.
- Adds property-based color value extraction using string indices "0", "1", "2", "3"
- Provides fallback logic for cases where array indexing fails
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
auto r = | ||
object.getProperty(runtime, jsi::PropNameID::forAscii(runtime, "0")) | ||
.asNumber(); | ||
auto g = | ||
object.getProperty(runtime, jsi::PropNameID::forAscii(runtime, "1")) | ||
.asNumber(); | ||
auto b = | ||
object.getProperty(runtime, jsi::PropNameID::forAscii(runtime, "2")) | ||
.asNumber(); | ||
auto a = | ||
object.getProperty(runtime, jsi::PropNameID::forAscii(runtime, "3")) | ||
.asNumber(); |
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.
The duplicated logic between the array access (lines 158-161) and property access approaches creates code duplication. Consider extracting the color conversion logic into a helper function that accepts the four color component values.
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
🎉 This PR is included in version 2.2.17 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
fixes #3275