-
Notifications
You must be signed in to change notification settings - Fork 24k
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
[v0.74] Android: Promises from native modules stuck #44555
Comments
|
|
Hey @cortinico , any thoughts about this one? I am not sure what can I do — I can't get Android Studio debugger to work on C++ RN code; I don't see any apparent issues with my code on TS & Java side; and although the issue reliably happens shortly after the app start-up, it is not in an deterministic way, sometimes I get it sooner, sometimes later. It feels like perhaps some dependency in the app, not correctly migrated to the new arch, does something wrong with communications to the native layer, and somehow rapidly exhaust the ability of bridgleless communication to handle new callbacks / promises... but I don't see anything in |
I'd say, let's start by attaching a reproducer to this issue. This week we're all busy with ReactConf so we won't be able to take a look at it |
I hope, ReactConf was fun :) Regarding my issue — following the trial-and-error approach, I tried to comment out different parts of my app relying on different 3rd party libraries, and narrowed it down to react-native-google-mobile-ads — if I don't use any functionality from it, my app works fine. Though, while I was testing that library got some fixes... thus, I am still to try whether the problem is there with v13.3.1 of that library, and if so, what might be causing it. |
@cortinico I have narrowed it down to the issue still happening with I am not sure why that event name was changed, and how may it affect unrelated promises not being resolved in the bridgeless mode. Though, if it makes any sense, I'd say RN misses to detect some problem here, and warn about it, or probably throw a hard error. |
Description
Hey, I am upgrading an existing app from RN v0.73.6 to v0.74.1, trying to make it work for Android, new architecture, bridge-less (and the app was working fine on RN v0.73 with new arch, and bridge; I haven't tested bridge-less before).
I've encountered an issue that shortly after running the app promises from native modules stuck to resolve or reject. I.e. in my code I have some function, say
doSmth(): Promise<void>
(which is a TS-side definition for a native function in a native module) that is called repeatedly, does some work on the native side, then doespromise.resolve(null)
on the native side, to resolve the pending promise on the TS side. It works for me fine at first, but after some call the promise fromdoSmth()
just stuck indefinitely without either resolve or reject.I've added console logging both at native and TS side, so I see that
promise.resolve(null)
is called at native side for that pending promise (i.e. I see console log from the line just before it); the call topromise.resolve(null)
does not fail (I have the native block of code wrapped intotry/catch
, and a log statement incatch
does not print); but on the TS side that promise stays pending (again, if I haven't miss anything, on TS side I have console statements just before the promise, after awaiting it, and I have entire block wrapped intotry/catch
with another console statement; and it nor statement after awaiting, nor in the catch prints).So... I am still trying to further dig into it, but already creating the ticket, just in case somebody has seen something similar, or has some helpful ideas / insights.
P.S.: In my current understanding, smth happens in C++ code implementation of promise resolution; and as of now I have no idea how to debug that in an RN app 😬 Ideally, I guess, I want to stick debugger breakpoint here in C++ code, to see what happens, but how? If in Android Studio I set breakpoints into C++ code of RN they do not seem to have effect :(
And I have confirmed that my app works seemingly fine with v0.74.1 if I disable bridge-less mode.
Steps to reproduce
N/A
React Native Version
N/A
Affected Platforms
Runtime - Android
Areas
Other (please specify)
Output of
npx react-native info
Stacktrace or Logs
Reproducer
N/A
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: