Skip to content

Fix random GitHub avatar on locally imported plugin rows - #128

Merged
dragonx943 merged 1 commit into
UsagiApp:develfrom
sang765:fix/local-plugin-random-avatar
Sep 27, 2026
Merged

dragonx943 merged 1 commit into
UsagiApp:develfrom
sang765:fix/local-plugin-random-avatar

Conversation

@sang765

@sang765 sang765 commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Problem

A locally imported plugin (no GitHub repository in its metadata) shows a random GitHub avatar in Manage plugins, and the avatar changes on every refresh.

Cause

PluginManageAdapter only sets a static drawable (ic_services / fallback favicon) for rows without a repository, but never cancels the Coil request left over from the previous holder of that recycled view. The request completes after the bind and overwrites the icon with whatever avatar was loaded before, so the row shows a stale GitHub avatar — whichever one the holder happened to render last.

Fix

  • Dispose the pending image request before setting a static icon in PluginManageAdapter (same pattern as ScrobblerConfigActivity).
  • Dispose the superseded request in CoilImageView.enqueueRequest, so an in-flight request from a recycled view can no longer land on the row that replaced it.

Testing

Code review only so far — the device build was skipped to avoid an OOM while compiling. Please verify locally: import a .jar, open Manage plugins, refresh a few times; the row keeps the static puzzle icon.

Plugin rows without a repository only set a static drawable, leaving the
Coil request from the recycled view holder alive. Its result lands after
the bind and overwrites the icon, so a local plugin shows whichever GitHub
avatar was loaded before, changing on every refresh.

Dispose the pending request before setting a static icon, and dispose
superseded requests when a new one is enqueued.
@sang765 sang765 added the bug Something isn't working label Sep 27, 2026
@sang765
sang765 marked this pull request as ready for review September 27, 2026 10:06
@sang765
sang765 requested a review from dragonx943 as a code owner September 27, 2026 10:06
@dragonx943
dragonx943 merged commit f8a2764 into UsagiApp:devel Sep 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants