Skip to content

[iOS] Fabric: Fixes image coordinator status assert crash in debug mode #47655

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -73,7 +73,9 @@ void ImageResponseObserverCoordinator::nativeImageResponseProgress(
int64_t total) const {
mutex_.lock();
auto observers = observers_;
react_native_assert(status_ == ImageResponse::Status::Loading);
react_native_assert(
status_ == ImageResponse::Status::Loading ||
status_ == ImageResponse::Status::Cancelled);
mutex_.unlock();

for (auto observer : observers) {
@@ -86,7 +88,9 @@ void ImageResponseObserverCoordinator::nativeImageResponseComplete(
mutex_.lock();
imageData_ = imageResponse.getImage();
imageMetadata_ = imageResponse.getMetadata();
react_native_assert(status_ == ImageResponse::Status::Loading);
react_native_assert(
status_ == ImageResponse::Status::Loading ||
status_ == ImageResponse::Status::Cancelled);
status_ = ImageResponse::Status::Completed;
auto observers = observers_;
mutex_.unlock();
@@ -99,7 +103,9 @@ void ImageResponseObserverCoordinator::nativeImageResponseComplete(
void ImageResponseObserverCoordinator::nativeImageResponseFailed(
const ImageLoadError& loadError) const {
mutex_.lock();
react_native_assert(status_ == ImageResponse::Status::Loading);
react_native_assert(
status_ == ImageResponse::Status::Loading ||
status_ == ImageResponse::Status::Cancelled);
status_ = ImageResponse::Status::Failed;
imageErrorData_ = loadError.getError();
auto observers = observers_;

Unchanged files with check annotations Beta

'use strict';
import type {RNTesterModule} from '../../types/RNTesterTypes';

Check warning on line 13 in packages/rn-tester/js/examples/DisplayContents/DisplayContentsExample.js

GitHub Actions / test_js (20)

Requires should be sorted alphabetically

Check warning on line 13 in packages/rn-tester/js/examples/DisplayContents/DisplayContentsExample.js

GitHub Actions / test_js (18)

Requires should be sorted alphabetically
import * as React from 'react';
import {StyleSheet, TextInput, View, Text} from 'react-native';