PostHog / posthog-js-lite

Reimplementation of posthog-js to be as light and modular as possible.
https://posthog.com/docs/libraries
MIT License
69 stars 36 forks source link

React Native Session Replay crash on Android - NoSuchKeyException: maskAllTextInputs #293

Closed SamYu closed 1 month ago

SamYu commented 1 month ago

Bug Description

Bug description

On Android, the app crashes immediately after opening the app before the splash screen ends. Problem doesn't occur on iOS.

Error log is: com.facebook.react.bridge.NoSuchKeyException: maskAllTextInputs

Devices this happens on:

OnePlus8Pro | Android 11 Xiaomi 23127PN0CG | Android 14 Pixel 6 Pro | Android 12 moto g play - 2024 | Android 13

Stack trace:

com.facebook.react.bridge.NoSuchKeyException: maskAllTextInputs
    at com.facebook.react.bridge.ReadableNativeMap.getValue(ReadableNativeMap.java:113)
    at com.facebook.react.bridge.ReadableNativeMap.getValue(ReadableNativeMap.java:117)
    at com.facebook.react.bridge.ReadableNativeMap.getBoolean(ReadableNativeMap.java:149)
    at com.posthogreactnativesessionreplay.PosthogReactNativeSessionReplayModule.start(PosthogReactNativeSessionReplayModule.kt:36)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:146)
    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:27)
    at android.os.Looper.loopOnce(Looper.java:224)
    at android.os.Looper.loop(Looper.java:318)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:233)
    at java.lang.Thread.run(Thread.java:1012)

How to reproduce

  1. Install session replay
  2. Open on Android phone

Additional context

SDK Versions: "posthog-react-native": "3.3.1" "posthog-react-native-session-replay": "^0.1.2" "expo": "~51.0.31" "react-native": "0.74.5"

Debug info

- [x] PostHog Cloud, Debug information: 
Session: https://us.posthog.com/project/sTMFPsFhdP1Ssg/replay/01926e44-8950-7f8f-9f6a-12f6100a7c1d?t=321
Admin: http://go/adminOrgUS/0190cd47-0a07-0000-233e-951b2d09fa60 (project ID 80513)
Sentry: http://go/sentryUS/80513
ide]
ioannisj commented 1 month ago

Hey SamYu,

This should be fixed with 3.3.6 (see https://github.com/PostHog/posthog-js-lite/pull/291).

Could you please update to latest and let us know if that takes care of the issue?

Btw, for future issues related to our React Native SDK please refer to this repo instead