react-native
react-native copied to clipboard
[iOS] Fix data race related to RCTNetworkTask.status
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.
| 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
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@javache merged this pull request in facebook/react-native@b1ec698dc4baf34ba2e31b7ad43dff97c229bf99.
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?