Skip to content

Issue/cmm 278 react response thread exception #21802

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 3 commits into from
Apr 15, 2025

Conversation

nbradbury
Copy link
Contributor

@nbradbury nbradbury commented Apr 14, 2025

Fixes #CMM-278

This PR makes sure we call onSuccess and onError in ReactNativeRequestHandler.handleResponse on the main thread.

We were unable to reproduce the problem, but the crash is a CalledFromWrongThreadException so calling from the main thread seems like the right solution (as suggested by Sentry's "Seer" AI). Note this is our leading crash right now, with 334 users and 1.1K events.

To test, I recommend simply setting a breakpoint on the two changes and verify it all works as expected.

@dangermattic
Copy link
Collaborator

dangermattic commented Apr 14, 2025

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 14, 2025

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr21802-2292055
Commit2292055
Direct Downloadwordpress-prototype-build-pr21802-2292055.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 14, 2025

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr21802-2292055
Commit2292055
Direct Downloadjetpack-prototype-build-pr21802-2292055.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented Apr 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 39.32%. Comparing base (64f0cea) to head (2292055).
Report is 1 commits behind head on trunk.

Files with missing lines Patch % Lines
.../ui/posts/reactnative/ReactNativeRequestHandler.kt 0.00% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #21802   +/-   ##
=======================================
  Coverage   39.32%   39.32%           
=======================================
  Files        2125     2125           
  Lines       99871    99871           
  Branches    15385    15385           
=======================================
  Hits        39277    39277           
  Misses      57114    57114           
  Partials     3480     3480           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nbradbury nbradbury marked this pull request as ready for review April 15, 2025 11:53
@nbradbury nbradbury requested a review from dcalhoun April 15, 2025 11:53
Copy link
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given we do not have reproduction steps, it is difficult to be confident this will address the crash. That said, given the crash reports, the proposed changes make sense.

I smoked tested both Gutenberg Mobile and GutenbergKit—adding various block types, uploading media, etc. I also tested offline editing. I did not encounter any issues. 🚀

@nbradbury nbradbury merged commit 7345e10 into trunk Apr 15, 2025
28 checks passed
@nbradbury nbradbury deleted the issue/CMM-278-react-response-thread-exception branch April 15, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants