Skip to content
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

[Crashlytics] com.facebook.react.modules.core.ExceptionsManagerModule.reportException #45054

Closed
muttmuure opened this issue Jul 9, 2024 · 17 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@muttmuure
Copy link
Contributor

Device
Brand:Samsung
Model:Galaxy A32
Orientation:Portrait
RAM free: 1.12 GB
Disk free: 85.48 GB
Operating System
Version:Android 13
Orientation:Portrait
Rooted:No
Crash
Date:Jul 9, 2024, 2:43:28 AM
App version:9.0.1-19 (1009000119)

com.expensify.chat_issue_022302da0d55dfb152b0c7d7d51a24a7_crash_session_668C94BE00D900013FE32CA2F10E910F_DNE_1_v2_stacktrace.txt

com.facebook.react.common.JavascriptException - TypeError: Cannot convert null value to object, js engine: hermes, stack: getAttachmentName@1:2818485 onPress@1:2814844 onPress@1:3167111 triggerPressAndUpdateSuccess@1:2960828 onPress@1:2221434 _performTransitionSideEffects@1:395251 _receiveSignal@1:39483
          Fatal Exception: com.facebook.react.common.JavascriptException: TypeError: right operand of 'in' is not an object, js engine: hermes, stack:
getWhisperedTo@1:3027695
isWhisperAction@1:3027851
isWhisperActionTargetedToOthers@1:3027881
shouldReportActionBeVisible@1:3032442
shouldReportActionBeVisibleAsLastAction@1:3032798
anonymous@1:3033284
getLastVisibleAction@1:3033238
getLastVisibleMessage@1:3033366
isEmptyReport@1:2506401
isUnread@1:2506472
anonymous@1:6701534
getUnreadReportsForUnreadIndicator@1:6701511
memoized@1:2138985
anonymous@1:6701804
invokeFunc@1:2835208
trailingEdge@1:2835538
timerExpired@1:2835487
anonymous@1:492897
_callTimer@1:492170
callTimers@1:493952
__callFunction@1:193552
anonymous@1:191041
__guard@1:192909
callFunctionReturnFlushedQueue@1:190999

       at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:65)
       at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:234)
       at java.lang.Thread.run(Thread.java:1012)
@muttmuure muttmuure added Weekly KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 9, 2024
Copy link

melvin-bot bot commented Jul 9, 2024

Triggered auto assignment to @CortneyOfstad (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 9, 2024
@muttmuure
Copy link
Contributor Author

@adhorodyski

@TMisiukiewicz
Copy link
Contributor

Hey, I'm Tomasz from Callstack and I'd like to work on this issue

@TMisiukiewicz
Copy link
Contributor

TMisiukiewicz commented Jul 9, 2024

@muttmuure is there any information when it was introduced for the first time? I was able to debug it and found out that it probably comes from the reportAction.message being null when it should be Message | undefined. I could do a quick fix that would prevent crashing an app but since I was not able to make a proper reproduction, I am not sure what is a root cause. Checking the list of changes in the version where it happened for the first time would be helpful

@muttmuure
Copy link
Contributor Author

Looks like it spiked around June 28th:
image

@TMisiukiewicz
Copy link
Contributor

and does it still happen on newer versions or there are no crash reports after 9.0.1-19?

@muttmuure
Copy link
Contributor Author

Those were the crash reports to date

@TMisiukiewicz
Copy link
Contributor

TMisiukiewicz commented Jul 10, 2024

So I was looking on it in the Crashlytics today and trying to reproduce it, but with no luck. When narrowed it to 9.0.1-19 version, looks like 71% of the crashes are happening when the app is in the background. I am wondering if it might be somehow related to push notifications. The error happens because a message in report action is null, I am curious if it might be a backend issue sending this value in some scenario or is it incorrectly set on the client side.

I also found a similar warning in Crashlytics, but coming from JS bundle, marked as non-fatal Exception here.

Basically I know how to solve it, it is a one-line change, but since I can't reproduce it, I don't know what steps should be done to test the solution 🙄

@muttmuure muttmuure moved this to CRITICAL in [#whatsnext] #quality Jul 10, 2024
@melvin-bot melvin-bot bot added the Overdue label Jul 12, 2024
@TMisiukiewicz
Copy link
Contributor

Since I still cannot reproduce it, and the Crashlytics are collecting data about this crash only for version 9.0.1-19, I'd suggest to wait and watch if the TypeError: right operand of 'in' is not an object still occurs in the latest versions

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jul 15, 2024
@CortneyOfstad
Copy link
Contributor

Sounds good — thank you @TMisiukiewicz!

@melvin-bot melvin-bot bot removed the Overdue label Jul 18, 2024
@TMisiukiewicz
Copy link
Contributor

Still no logs for Fatal Exception: com.facebook.react.common.JavascriptException: TypeError: right operand of 'in' is not an object, js engine: hermes, stack: getWhisperedTo@1:3027695 in newer versions. However, I noticed that com.facebook.react.modules.core.ExceptionsManagerModule.reportException collects all of the crashes coming from JS thread under one issue, so when I am going through stack traces, I can distinguish the following errors leading to crashes occurring in the latest versions:

TypeError: right operand of 'in' is not an object - ReportIDsContextProvider
Fatal Exception: com.facebook.react.common.JavascriptException: TypeError: right operand of 'in' is not an object

This error is located at:
    in ReportIDsContextProvider
    in ActiveWorkspaceContextProvider
    in ActiveElementRoleProvider
    in CustomStatusBarAndBackgroundContextProvider
    in EnvironmentProvider
    in PickerStateProvider
    in ReportAttachmentsProvider
    in ScrollOffsetContextProvider
    in withOnyx(ScrollOffsetContextProvider)
    in Unknown
    in CurrentReportIDContextProvider
    in PopoverContextProvider
    in KeyboardStateProvider
    in WindowDimensionsProvider
    in RenderersPropsProvider
    in ListStyleSpecsProvider
    in SharedPropsProvider
    in RenderRegistryProvider
    in RenderHTMLConfigProvider
    in TRenderEngineProvider
    in BaseHTMLEngineProvider
    in HTMLEngineProvider
    in LocaleContextProvider
    in withOnyx(LocaleContextProvider)
    in Unknown
    in WithCurrentUserPersonalDetails(Component)
    in _default
    in PortalProviderComponent
    in RNCSafeAreaProvider
    in SafeAreaProvider
    in ThemeIllustrationsProvider
    in ThemeStylesProvider
    in ThemeProvider
    in AccountProvider
    in withOnyx(AccountProvider)
    in Unknown
    in SessionProvider
    in withOnyx(SessionProvider)
    in Unknown
    in Nvp_expensify_preferredEmojiSkinToneProvider
    in withOnyx(Nvp_expensify_preferredEmojiSkinToneProvider)
    in Unknown
    in Nvp_expensify_frequentlyUsedEmojisProvider
    in withOnyx(Nvp_expensify_frequentlyUsedEmojisProvider)
    in Unknown
    in PreferredThemeProvider
    in withOnyx(PreferredThemeProvider)
    in Unknown
    in ReportDraftComment_Provider
    in withOnyx(ReportDraftComment_Provider)
    in Unknown
    in BetasProvider
    in withOnyx(BetasProvider)
    in Unknown
    in Nvp_private_blockedFromConciergeProvider
    in withOnyx(Nvp_private_blockedFromConciergeProvider)
    in Unknown
    in CurrentDateProvider
    in withOnyx(CurrentDateProvider)
    in Unknown
    in ReportActionsDrafts_Provider
    in withOnyx(ReportActionsDrafts_Provider)
    in Unknown
    in PersonalDetai<truncated: 1021 chars>
       at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:65)
       at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:959)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
       at android.os.Looper.loopOnce(Looper.java:232)
       at android.os.Looper.loop(Looper.java:317)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:234)
       at java.lang.Thread.run(Thread.java:1012)
TypeError: right operand of 'in' is not an object - isResolvedActionTrackExpense
          Fatal Exception: com.facebook.react.common.JavascriptException: TypeError: right operand of 'in' is not an object, js engine: hermes, stack:
isResolvedActionTrackExpense@1:3076372
shouldReportActionBeVisibleAsLastAction@1:3076573
anonymous@1:3077049
getLastVisibleAction@1:3077001
getLastVisibleMessage@1:2541502
isEmptyReport@1:2573711
isUnread@1:2573782
anonymous@1:3471986
getUnreadReportsForUnreadIndicator@1:3471963
memoized@1:2151663
anonymous@1:3472312
invokeFunc@1:2514740
trailingEdge@1:2515070
timerExpired@1:2515019
anonymous@1:499374
_callTimer@1:498645
callTimers@1:500433
__callFunction@1:199931
anonymous@1:197417
__guard@1:199287
callFunctionReturnFlushedQueue@1:197375

       at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:65)
       at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:958)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
       at android.os.Looper.loopOnce(Looper.java:205)
       at android.os.Looper.loop(Looper.java:294)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:234)
       at java.lang.Thread.run(Thread.java:1012)
        
TypeError: undefined is not a function
 Fatal Exception: com.facebook.react.common.JavascriptException: TypeError: undefined is not a function, js engine: hermes, stack:
init@1:2323334
_default@1:7673375
anonymous@1:180908
loadModuleImplementation@1:170989
guardedLoadModule@1:170179
metroRequire@1:169506
global@1:168441

       at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:65)
       at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:958)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
       at android.os.Looper.loopOnce(Looper.java:230)
       at android.os.Looper.loop(Looper.java:319)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:234)
       at java.lang.Thread.run(Thread.java:1012)
TypeError: Cannot read property 'routes' of undefined
          Fatal Exception: com.facebook.react.common.JavascriptException: TypeError: Cannot read property 'routes' of undefined, js engine: hermes, stack:
onBackPress@1:7675381
anonymous@1:1137735
emit@1:194390
emit@1:190480
__callFunction@1:200223
anonymous@1:197709
__guard@1:199579
callFunctionReturnFlushedQueue@1:197667

       at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:65)
       at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:959)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
       at android.os.Looper.loopOnce(Looper.java:232)
       at android.os.Looper.loop(Looper.java:317)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:234)
       at java.lang.Thread.run(Thread.java:1012)
Error: TaskQueue: Error with task : [Pusher] instance not found. Pusher.subscribe() most likely has been called before Pusher.init()
Fatal Exception: com.facebook.react.common.JavascriptException: Error: TaskQueue: Error with task : [Pusher] instance not found. Pusher.subscribe()
            most likely has been called before Pusher.init(), js engine: hermes, stack:
anonymous@1:2938635
processNext@1:761178
_processUpdate@1:759885
anonymous@1:500012
_callTimer@1:498935
_callReactNativeMicrotasksPass@1:499131
callReactNativeMicrotasks@1:501081
__callReactNativeMicrotasks@1:199705
anonymous@1:197911
__guard@1:199579
flushedQueue@1:197822

       at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:65)
       at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:959)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
       at android.os.Looper.loopOnce(Looper.java:232)
       at android.os.Looper.loop(Looper.java:317)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:234)
       at java.lang.Thread.run(Thread.java:1012)

Can we make separate issues for all of those with [Crashlytics] prefix? Our Callstack team could take a look on those

@melvin-bot melvin-bot bot added the Overdue label Jul 22, 2024
Copy link

melvin-bot bot commented Jul 22, 2024

@CortneyOfstad, @TMisiukiewicz Whoops! This issue is 2 days overdue. Let's get this updated quick!

@CortneyOfstad
Copy link
Contributor

@TMisiukiewicz — sounds good! I will get on that, and link them here once completed!

@melvin-bot melvin-bot bot removed the Overdue label Jul 22, 2024
Copy link

melvin-bot bot commented Jul 23, 2024

@CortneyOfstad @TMisiukiewicz this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@TMisiukiewicz
Copy link
Contributor

@CortneyOfstad thank you!

@melvin-bot melvin-bot bot added the Overdue label Jul 26, 2024
@muttmuure
Copy link
Contributor Author

Let's close in favour of the separated issues. Thanks @CortneyOfstad!

@melvin-bot melvin-bot bot removed the Overdue label Jul 29, 2024
@github-project-automation github-project-automation bot moved this from CRITICAL to Done in [#whatsnext] #quality Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
Status: Done
Development

No branches or pull requests

3 participants