android / android/socialite

Bug : Sending a message

Open
#41 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
721
Forks
162
PR merge metrics
No merged PRs in 30d

Description

- Issue
Sending a message and navigating to the chat list crashes and closes the app

https://github.com/android/socialite/assets/38935359/ee95ae46-76b0-4249-ad4f-fc3986f6301e

- StackTrace
```
com...gle.android.samples.socialite E FATAL EXCEPTION: pool-2-thread-1
Process: com.google.android.samples.socialite, PID: 2421
java.lang.IllegalArgumentException: Context is required to resolve the file uri of the icon: content://com.google.android.samples.socialite/icon/1
at androidx.core.graphics.drawable.IconCompat$Api23Impl.toIcon(IconCompat.java:1297)
at androidx.core.graphics.drawable.IconCompat.toIcon(IconCompat.java:529)
at androidx.core.graphics.drawable.IconCompat.toIcon(IconCompat.java:517)
at androidx.core.app.Person$Api28Impl.toAndroidPerson(Person.java:427)
at androidx.core.app.Person.toAndroidPerson(Person.java:152)
at androidx.core.app.NotificationCompatBuilder.(NotificationCompatBuilder.java:263)
at androidx.core.app.NotificationCompat$Builder.build(NotificationCompat.java:2531)
at com.google.android.samples.socialite.repository.NotificationHelper.showNotification(NotificationHelper.kt:274)
at com.google.android.samples.socialite.repository.NotificationHelper.showNotification$default(NotificationHelper.kt:159)
at com.google.android.samples.socialite.repository.ChatRepository$sendMessage$2.invokeSuspend(ChatRepository.kt:92)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@285c18d, java.util.concurrent.Executors$FinalizableDelegatedExecutorService@3fa8f42]
```

Contributor guide

Open the contributing guide

Research direction

Start at NotificationHelper.kt:274 and ChatRepository.kt:92, following the stack trace through notification construction and the icon URI conversion. Reproduce sending a message and navigating to the chat list, then verify that this flow no longer crashes or closes the app.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.