react-native icon indicating copy to clipboard operation
react-native copied to clipboard

fix: android native rejections should be instanceof Error

Open huzhanbo1996 opened this issue 1 year ago • 6 comments

Summary:

fix #44050

Changelog:

[ANDROID] [FIXED] - fix: android native rejections should be instanceof Error

Test Plan:

reject returns Error.

huzhanbo1996 avatar May 08 '24 13:05 huzhanbo1996

Hi, @javache

As in #44051, you suggests that a fix from Java to C++. But I found out that same as fix on iOS #41955, we can treat reject on C++.

If we want to fix it from Java, we probably need a Java Error type (currently WritableNativeMap is universal argument for callback), and the argument conversion should support Java Error -> Dynamic -> JSI Object to this specific type. It looks this solution needs huge work.

If you have any other ideas, please let me know.

huzhanbo1996 avatar May 08 '24 13:05 huzhanbo1996

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 19,495,386 -45,446
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 22,867,572 -44,417
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 54f582f651c68e9fa6bedb5d1546f4e5a4a64704 Branch: main

analysis-bot avatar May 08 '24 13:05 analysis-bot

Looks good overall, just a few nits

javache avatar May 09 '24 20:05 javache

Looks good overall, just a few nits

Thanks for the advice. Changes updated, PTAL again

huzhanbo1996 avatar May 10 '24 05:05 huzhanbo1996

@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar May 10 '24 10:05 facebook-github-bot

@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Hi @javache, is the CI check OK?

huzhanbo1996 avatar May 13 '24 14:05 huzhanbo1996

@javache merged this pull request in facebook/react-native@62cbdbbcc60f9074e47416007aef81e0792d7c95.

facebook-github-bot avatar May 14 '24 12:05 facebook-github-bot

This pull request was successfully merged by huzhanbo.luc in 62cbdbbcc60f9074e47416007aef81e0792d7c95.

When will my fix make it into a release? | How to file a pick request?

github-actions[bot] avatar May 14 '24 12:05 github-actions[bot]