code-with-the-italians / bundel

A digital wellbeing Android app that helps minimise distractions when you don't want them. Watch us live code it at https://cwti.link/twitch or catch up on YouTube at https://cwti.link/yt. Merch available at https://cwti.link/spaccio.
https://codewiththeitalians.it
Apache License 2.0
288 stars 26 forks source link

Crash on giving notification access #4

Closed shipsywor closed 3 years ago

shipsywor commented 3 years ago

Describe the bug App crashes on giving notification access

To Reproduce Steps to reproduce the behavior:

  1. Open project in Android Studio.
  2. Run it on Emulator API 29 or API 30
  3. Give notification access to the app on device
  4. App Crashes

Error via logcat:

2021-05-14 14:38:24.583 11014-11014/dev.sebastiano.bundel E/AndroidRuntime: FATAL EXCEPTION: main
    Process: dev.sebastiano.bundel, PID: 11014
    java.lang.RuntimeException: Tried to marshall a Parcel that contained Binder objects.
        at android.os.Parcel.nativeMarshall(Native Method)
        at android.os.Parcel.marshall(Parcel.java:552)
        at dev.sebastiano.bundel.storage.NotificationsCache.toByteArray(NotificationsCache.kt:53)
        at dev.sebastiano.bundel.storage.NotificationsCache.writeToFile(NotificationsCache.kt:44)
        at dev.sebastiano.bundel.storage.NotificationsCache.storeStatusBarNotification(NotificationsCache.kt:36)
        at dev.sebastiano.bundel.storage.RobertoRepository$saveNotification$2.invokeSuspend(RobertoRepository.kt:24)

Expected behavior To not crash

rock3r commented 3 years ago

Thanks for the report! We're aware, the app crashes not because of the permission but because we were trying to store notifications in a bad way. We'll fix this on Sunday's stream :)

rock3r commented 3 years ago

We've fixed it now :)