Repository navigation
fix(android): resolve resize and dismiss when the native view is gone - #1026
Closed
SamuelBrucksch wants to merge 2 commits into
Closed
SamuelBrucksch wants to merge 2 commits into
SamuelBrucksch wants to merge 2 commits into
Conversation
|
@SamuelBrucksch is attempting to deploy a commit to the lodev09 Team on Vercel. A member of the Team first needs to authorize it. |
SamuelBrucksch
added a commit
to SamuelBrucksch/react-native-true-sheet
that referenced
this pull request
Nov 17, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
onHostDestroy drops the view from the module's registry, but when the activity is destroyed while the JS runtime keeps running, the JS sheet stays mounted. resize(), dismiss() and dismissStack() then reject with VIEW_NOT_FOUND, which surfaces as an unhandled rejection when callers don't await them. Ignore VIEW_NOT_FOUND / SHEET_NOT_FOUND in those three methods; present() still rejects. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
SamuelBrucksch
force-pushed
the
fix/android-missing-view-ref-methods
branch
from
November 17, 2026 11:01
a314271 to
baae4b2
Compare
SamuelBrucksch
marked this pull request as draft
November 17, 2026 11:03
Contributor
Author
|
Still need to check something... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #921, which fixed this for
handleBackPress.On Android,
TrueSheetView.onHostDestroydrops the view from the module's registry. When the activity is destroyed but the JS runtime keeps running (a foreground service, or the process staying alive in the background), the JS sheet is still mounted. Effects that callref.resize(),ref.dismiss()orref.dismissStack()then reachwithTrueSheetView, which rejects:Apps typically fire these calls without awaiting them (
void sheetRef.current?.resize(i)), so the rejection becomes an unhandled promise rejection. In our production app this is ~6.7k events from ~3.5k users, all on Android. Breadcrumbs always showMainActivity destroyed, followed 0.2–2 s later by the rejection.Fix:
resize,dismissanddismissStackignoreVIEW_NOT_FOUND(Android) andSHEET_NOT_FOUND(iOS) and resolve. A sheet whose native view no longer exists has nothing left to resize or dismiss. Every other error still rejects.present()is unchanged: if the view is gone, the caller asked to show something that can't be shown, so it should still find out.Type of Change
Test Plan
resize,dismissanddismissStackresolve on both codes, and other native errors still reject. The two resolve tests fail onmainand pass here.jest.setup.jsnow mocksresizeByRefanddismissStackByRefas well.Screenshots / Videos
N/A
Checklist
🤖 Generated with Claude Code