android icon indicating copy to clipboard operation
android copied to clipboard

Add Logs For Passed File Sizes

Open alperozturk96 opened this issue 1 year ago • 2 comments

  • [x] Tests written, or not not needed

What is the Problem?

App sometimes throws TransactionTooLargeException. Back trace not helping too much.

e.g. Backtrace

Exception java.lang.RuntimeException:
  at android.app.servertransaction.PendingTransactionActions$StopInfo.run (PendingTransactionActions.java:146)
  at android.os.Handler.handleCallback (Handler.java:958)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:230)
  at android.os.Looper.loop (Looper.java:319)
  at android.app.ActivityThread.main (ActivityThread.java:8893)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:608)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)
Caused by android.os.TransactionTooLargeException: data parcel size 594696 bytes
  at android.os.BinderProxy.transactNative
  at android.os.BinderProxy.transact (BinderProxy.java:662)
  at android.app.IActivityClientController$Stub$Proxy.activityStopped (IActivityClientController.java:1507)
  at android.app.ActivityClient.activityStopped (ActivityClient.java:100)
  at android.app.servertransaction.PendingTransactionActions$StopInfo.run (PendingTransactionActions.java:135)

The TransactionTooLargeException can be thrown due to the following reasons:

  1. Including large objects in Bundles or Intents.
  2. Using onSaveInstanceState to save the UI state with large data.

What this PR does?

Add logs to print file size so that we can check passed file sizes.

alperozturk96 avatar Jun 19 '24 13:06 alperozturk96

Codacy

Lint

TypemasterPR
Warnings6363
Errors33

SpotBugs

CategoryBaseNew
Bad practice6464
Correctness6565
Dodgy code315315
Experimental11
Internationalization77
Multithreaded correctness66
Performance5553
Security1818
Total531529

github-actions[bot] avatar Jul 01 '24 07:07 github-actions[bot]

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/13151.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

github-actions[bot] avatar Jul 01 '24 07:07 github-actions[bot]