chore: sync upstream PR #8275 - fix(android): preserve file chooser callback across activity recreation#99
chore: sync upstream PR #8275 - fix(android): preserve file chooser callback across activity recreation#99riderx wants to merge 2 commits into
Conversation
Fixes ionic-team#8246 When the Android system destroys and recreates the Activity while a file picker is open (due to backgrounding or memory pressure), the ValueCallback reference is lost, causing file uploads to fail silently. This fix stores the file chooser callbacks in static variables so they survive activity recreation. When the activity result is received: - If the instance callback exists, it's used normally - If the instance callback is null, the static pending callback is used Changes: - Added static variables to store pending file path callback, image URI, and file chooser type - Added FileChooserType enum to track which picker was opened - Added handlePendingFileChooserResult() to handle results when activity was recreated - Added clearPendingFileChooserState() to clean up static state - Updated showImageCapturePicker(), showVideoCapturePicker(), and showFilePicker() to store callbacks before launching
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
Beta npm buildMaintainers can publish one Capacitor Plus workspace package from this PR to npm for fast testing. Comment Examples: /publish-beta core
/publish-beta cli
/publish-beta @capacitor-plus/coreIf exactly one workspace package changed, Packages:
The workflow will:
Security note: beta publish is only enabled for branches inside this repository. |
There was a problem hiding this comment.
Risk: medium. Not approving: this Android file-chooser lifecycle fix is user-facing and uses static callback state without test evidence, above the low-risk approval threshold. Cursor Bugbot was not present; human review is needed before merge.
Sent by Cursor Approval Agent: Pull Request Approver External


Upstream PR Sync
This PR syncs changes from an external contributor's PR on the official Capacitor repository.
Original PR
Automation
Synced from upstream by Capacitor+ Bot