unraid / unraid/webgui

Missing icon cache is too aggressive

Open Beginner friendly
#2,713 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
253
Forks
106
Avg merge
6d 22h
Merged PRs (30d)
12

Description

When a container is created and it doesn't have an icon, it will default to the question mark. However, if a valid image is defined later, even when the container is recreated and you hard refresh in browser, it's still the question mark.

If you look at DockerClient.php:

https://github.com/unraid/webgui/blob/8d40212ca286a39d6a1aea75768a76787afb46b2/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php#L346

So then it gets persisted into state/plugins/dynamix.docker.manager/docker.json permanently unless manually changed. I think the code that exists for this case where it's missing the icon so it uses the fallback but then it gets a valid icon so then it changes to the correct icon is faulty;

https://github.com/unraid/webgui/blob/8d40212ca286a39d6a1aea75768a76787afb46b2/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php#L340-L341

Because this will always evaluate as true since the placeholder image does exist, the check for a proper icon never runs again. The only solution is to manually edit the icon field in docker.json.

Might be related to #2691?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with emhttp/plugins/dynamix.docker.manager/include/DockerClient.php around lines 340-346 and inspect how the fallback icon is persisted in state/plugins/dynamix.docker.manager/docker.json. Reproduce the sequence with a container that first lacks an icon and later receives a valid image, then verify that recreation and a browser refresh show the valid icon without manually editing docker.json.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.