Skip to content

App crashes when open new file #992

@da411d

Description

@da411d

Describe the bug

The app crashes when I open attached pdf file

To Reproduce

  1. Send pdf-file from messenger to chatwoot-powered ?Telegram? chat bot

Expected behavior

The file opens in default associated app

Screenshots

Screen_Recording_20251222_015915_Nova.Launcher.mp4

Observed behavior

The app crashes

Environment

  • Describe whether you are using Chatwoot Cloud (app.chatwoot.com) or a self hosted installation of Chatwoot.
  • Device Name: Samsung Galaxy S24 (SM-S9210)
  • OS Version: Android 16; OneUI 8.0
  • Chatwoot App Version: 4.3.10 (5180183)
  • Chatwoot Server Version: 4.8.0

Additional context

Logcat
--------- beginning of crash
12-22 01:49:54.109 17798 17848 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
12-22 01:49:54.109 17798 17848 E AndroidRuntime: Process: com.chatwoot.app, PID: 17798
12-22 01:49:54.109 17798 17848 E AndroidRuntime: com.facebook.react.bridge.UnexpectedNativeTypeException: Value for title cannot be cast from ReadableNativeMap to String
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at com.facebook.react.bridge.ReadableNativeMap.getString(SourceFile:77)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at com.facebook.react.modules.dialog.DialogModule.showAlert(SourceFile:30)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at com.facebook.react.bridge.JavaMethodWrapper.invoke(SourceFile:151)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at com.facebook.react.bridge.JavaModuleWrapper.invoke(SourceFile:20)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at com.facebook.jni.NativeRunnable.run(Native Method)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:995)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:103)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(SourceFile:1)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:273)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:363)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadImpl.lambda$startNewBackgroundThread$2(SourceFile:36)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadImpl.b(SourceFile:1)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at com.facebook.react.bridge.queue.b.run(SourceFile:1)
12-22 01:49:54.109 17798 17848 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:1119)
12-22 01:49:54.128 17798 17819 W qdgralloc: getInterlacedFlag: getMetaData returned 3, defaulting to interlaced_flag = 0
12-22 01:49:54.306 17798 17848 I Process : Sending signal. PID: 17798 SIG: 9

Possible fixes

Seems the error happens during file opening failure, when trying to alert the exception, which is incorrect type:

FileViewer.open(localFilePath).catch(e => Alert.alert(e));

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions