Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avatars randomly not loading #3354

Closed
frebib opened this issue Aug 28, 2024 · 5 comments · Fixed by #3366
Closed

Avatars randomly not loading #3354

frebib opened this issue Aug 28, 2024 · 5 comments · Fixed by #3366
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@frebib
Copy link
Contributor

frebib commented Aug 28, 2024

Steps to reproduce

The easiest reliable reproducer I have found for this issue is

  1. Close the app fully via the app switcher
  2. Open it and hit the People filter
  3. Observe that some of the avatars do not load

Outcome

What did you expect?

Avatars to load reliably, even if not immediately. It's not always the same avatar, and it doesn't always happen. Once they've loaded once, they seem to stay loaded until the app is killed.

What happened instead?

They never loaded until navigating away and back or scrolling them out and back into view.

I also notice lots of instances of this error in the logs, which seems related

2024-08-28T20:25:44.934428Z ERROR elementx: Error loading avatar Error(painter=null, result=coil.request.ErrorResult@c8327ec0)
coil.request.ErrorResult@c8327ec0
java.lang.IllegalStateException: Unable to create a fetcher that supports: AvatarData(id=@daedric:aguiarvieira.pt, name=Ricardo Duarte, url=mxc://aguiarvieira.pt/d812aea45985cea20470b56a60e10182749cce5d1809387807983009792, size=TimelineReadReceipt)
        at coil.intercept.EngineInterceptor.fetch(SourceFile:260
        at coil.intercept.EngineInterceptor$fetch$1.invokeSuspend(SourceFile:18)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:9)
        at kotlinx.coroutines.DispatchedTask.run(SourceFile:113)
        at com.google.android.gms.tasks.zzc.run(SourceFile:49)
        at kotlinx.coroutines.scheduling.TaskImpl.run(SourceFile:3)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:96)
 |

I also see it for rooms occasionally too

2024-08-28T20:56:44.650079Z ERROR elementx: Error loading avatar Error(painter=null, result=coil.request.ErrorResult@645f6498)
coil.request.ErrorResult@645f6498
java.lang.IllegalStateException: Unable to create a fetcher that supports: AvatarData(id=!aCvOWKNDeXXpPgquKq:matrix.org, name=Element X Android, url=mxc://matrix.org/MKuJjqbRDmkHNMzEjNNbhurH, size=RoomListItem)
        at coil.intercept.EngineInterceptor.fetch(SourceFile:260)
        at coil.intercept.EngineInterceptor$fetch$1.invokeSuspend(SourceFile:18)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:9)
        at kotlinx.coroutines.DispatchedTask.run(SourceFile:113)
        at com.google.android.gms.tasks.zzc.run(SourceFile:49)
        at kotlinx.coroutines.scheduling.TaskImpl.run(SourceFile:3)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:96)
 |

Your phone model

Pixel 8 Pro

Operating system version

Android 14

Application version and app store

https://github.com/frebib/element-x-android/commits/c7989af09b6e9c22747e05be0d4a530e0165a733

Homeserver

nerdhouse.io

Will you send logs?

Yes

Are you willing to provide a PR?

No

@frebib frebib added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Aug 28, 2024
@SpiritCroc
Copy link
Contributor

Happens here too since the v0.5.1 merge (v0.5.0 was fine).

Re frebib's logs:

java.lang.IllegalStateException: Unable to create a fetcher that supports

IIRC that basically happens when our custom fetcher (here: CoilMediaFetcher) returns null. I don't see any change in there or in the related MediaLoader for v0.5.0 -> v0.5.1 on first glance though. 🤔

@bmarty
Copy link
Member

bmarty commented Aug 30, 2024

Thanks for reporting.

On my side:

  • can't repro on the latest 0.5.1 nightly (August 28)
  • can repro on today's nightly (August 30).

We are checking what has been changed between those 2 versions.

@bmarty
Copy link
Member

bmarty commented Aug 30, 2024

OK, I can now reproduce on a debug build. I have added more log and the method getMediaThumbnail is returning an error. Here is the log:

E elementx: org.matrix.rustcomponents.sdk.ClientException$Generic: msg=database is locked

We can have a retry mechanism application side, but this is maybe something we want to handle SDK side. WDYT @Hywan ?

bmarty added a commit that referenced this issue Aug 30, 2024
… try to access a locked DB.

Error from the SDK can be `database is locked`
See #3354
@bnjbvr
Copy link
Member

bnjbvr commented Sep 2, 2024

Are avatars read all from the same process? or could it be that multiple processes are reading avatars on Android?

@bmarty
Copy link
Member

bmarty commented Sep 3, 2024

@bnjbvr same process, but multiple threads.

FTR #3366 does not include the fix anymore, but the issue will be fixed in the SDK in matrix-org/matrix-rust-sdk#3928

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants