Skip to content

fix: cherry pick "[iOS] Reland: avoid race condition crash in [RCTDataRequestHandler invalidate]" #2450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

Saadnajmi
Copy link
Collaborator

@Saadnajmi Saadnajmi commented Mar 31, 2025

Cherry pick facebook#50342 , which fixes a bug with our fix from #2383

I chose to omit the macOS tags as this is a cherry-pick.

…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 merged commit 1129083 into microsoft:main Apr 8, 2025
12 checks passed
@Saadnajmi Saadnajmi deleted the strongop branch April 8, 2025 21:07
Saadnajmi added a commit that referenced this pull request Apr 8, 2025
…RCTDataRequestHandler invalidate]" (#2451)

Backport #2450 to `0.78-stable`

---------

Co-authored-by: zhongwuzw <[email protected]>
Saadnajmi added a commit that referenced this pull request Apr 8, 2025
…RCTDataRequestHandler invalidate]" (#2453)

Backport #2450 to `0.76-stable`

---------

Co-authored-by: zhongwuzw <[email protected]>
Saadnajmi added a commit that referenced this pull request Apr 8, 2025
…RCTDataRequestHandler invalidate]" (#2452)

Backport #2450 to `0.77-stable`

---------

Co-authored-by: zhongwuzw <[email protected]>
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