Skip to content
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

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

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
Expand Up @@ -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) {
Expand All @@ -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();
Expand All @@ -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_;
Expand Down
Loading