ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
11.24k stars 955 forks source link

[Bug]: HTTP-Plugin on iOS: load events not fired #7416

Closed wif70068 closed 2 weeks ago

wif70068 commented 4 weeks ago

Capacitor Version

Latest Dependencies:

@capacitor/cli: 6.0.0 @capacitor/core: 6.0.0 @capacitor/android: 6.0.0 @capacitor/ios: 6.0.0

Installed Dependencies:

@capacitor/cli: 5.7.4 @capacitor/android: 5.7.4 @capacitor/ios: 5.7.4 @capacitor/core: 5.7.4

Other API Details

npm: 10.5.0
node: v21.7.1
pod: 1.15.2

Platforms Affected

Current Behavior

Upon launching the app, we've observed intermittent occurrences where an XHR request, configured with CapacitorHttp: { enabled: true }, fails to trigger a response. None of the expected events such as load, loadend, abort, progress, or error are triggered, leaving the xhr request indefinitely in readystate=2. External network issues have been ruled out, and the iOS console confirms successful completion of the request.

Reproducing this issue is challenging, but similar behavior was encountered when setting JavaScript debug breakpoints after the request initiation but before its completion. Upon resuming execution, the expected events failed to trigger.

Further investigation revealed that certain lines (788, 828, or 851) within native-bridge.ts (https://github.com/ionic-team/capacitor/blob/main/core/native-bridge.ts) are never reached, indicating potential loss of the native response.

Expected Behavior

The request finishes successfully.

Project Reproduction

.

Additional Information

No response

wif70068 commented 3 weeks ago

our monitoring just witnessed the first case on android. Can't reproduce with setting JavaScript debug breakpoints on Android.

ionitron-bot[bot] commented 3 weeks ago

This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed. Please see the Contributing Guide for how to create a Sample App. Thanks! Ionitron 💙

wif70068 commented 2 weeks ago

We are not able to reproduce it without setting a debug point