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

[iOS] Fix data race related to RCTNetworkTask.status

Open hakonk opened this issue 1 year ago • 2 comments

Fix entails using non-synthesized getter, such that underlying backing is an std::atomic<RCTNetworkTaskStatus>.

In the greater scheme of things, I believe RCTNetworkTask should be improved as it has several nonatomic properties that are read and written to on different threads. Thread safety of this class seems to have been addressed on a per property basis, judging from the employment of std::mutex elsewhere in the implementation.

Summary:

This is an attempt at fixing https://github.com/facebook/react-native/issues/44687.

Changelog:

[iOS][FIXED] - Fix data race related to access on RCTNetworkTask.status.

Test Plan:

Added unit test in class RCTNetworkTaskTests.

hakonk avatar May 28 '24 10:05 hakonk

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 20,315,970 -50,134
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 23,513,270 -49,638
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: c7988c9c82793b6b41d4c9190a28ce1202410fa0 Branch: main

analysis-bot avatar May 28 '24 11:05 analysis-bot

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

facebook-github-bot avatar Jul 01 '24 09:07 facebook-github-bot

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

facebook-github-bot avatar Jul 03 '24 15:07 facebook-github-bot

This pull request was successfully merged by @hakonk in b1ec698dc4baf34ba2e31b7ad43dff97c229bf99.

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

github-actions[bot] avatar Jul 03 '24 15:07 github-actions[bot]