Skip to content

fix(0.78): cherry pick "[iOS] Reland: avoid race condition crash in [RCTDataRequestHandler invalidate]"#2451

Merged
Saadnajmi merged 2 commits intomicrosoft:0.78-stablefrom
Saadnajmi:strongop-78
Apr 8, 2025
Merged

fix(0.78): cherry pick "[iOS] Reland: avoid race condition crash in [RCTDataRequestHandler invalidate]"#2451
Saadnajmi merged 2 commits intomicrosoft:0.78-stablefrom
Saadnajmi:strongop-78

Conversation

@Saadnajmi
Copy link
Copy Markdown
Collaborator

Backport #2450 to 0.78-stable

…te (facebook#50342)

Summary:
Reland facebook@6bc5dde, the reason the previous commit has an issue is `weakOp` would always `nil` when captured in block :https://github.com/facebook/react-native/blob/6bc5ddea3ea3ca20060ea0181630539931948085/packages/react-native/Libraries/Network/RCTDataRequestHandler.mm#L52-L54

Now, we can create an `NSBlockOperation` and use `addExecutionBlock` instead. `weakOp` can be captured correctly.

[IOS] [FIXED] - Reland: avoid race condition crash in [RCTDataRequestHandler invalidate

Pull Request resolved: facebook#50342

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D72047232

Pulled By: javache

fbshipit-source-id: c3a5a9fca909f7eac16d78b650c9ea9f5b8e64e4
@Saadnajmi Saadnajmi requested a review from a team as a code owner March 31, 2025 17:58
@Saadnajmi Saadnajmi changed the title Reland: avoid race condition crash in [RCTDataRequestHandler invalida… fix(0.78): cherry pick "[iOS] Reland: avoid race condition crash in [RCTDataRequestHandler invalidate]" Mar 31, 2025
@Saadnajmi Saadnajmi merged this pull request into microsoft:0.78-stable Apr 8, 2025
8 of 10 checks passed
@Saadnajmi Saadnajmi deleted the strongop-78 branch April 8, 2025 22:40
@Saadnajmi Saadnajmi restored the strongop-78 branch April 8, 2025 22:51
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