Skip to content

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

Merged
Saadnajmi merged 1 commit intomicrosoft:0.74-stablefrom
Saadnajmi:strongop-74
Apr 8, 2025
Merged

fix(0.74): cherry pick "[iOS] Reland: avoid race condition crash in [RCTDataRequestHandler invalidate]"#2455
Saadnajmi merged 1 commit intomicrosoft:0.74-stablefrom
Saadnajmi:strongop-74

Conversation

@Saadnajmi
Copy link
Copy Markdown
Collaborator

Backport #2450 to 0.74-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 18:03
@Saadnajmi Saadnajmi changed the title fix(0.75): cherry pick "[iOS] Reland: avoid race condition crash in [RCTDataRequestHandler invalidate]" fix(0.74): cherry pick "[iOS] Reland: avoid race condition crash in [RCTDataRequestHandler invalidate]" Mar 31, 2025
@Saadnajmi Saadnajmi merged commit ab40d05 into microsoft:0.74-stable Apr 8, 2025
11 checks passed
@Saadnajmi Saadnajmi deleted the strongop-74 branch April 8, 2025 22:09
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