fix: don't delete the shared default docker icon when removing an icon-less container#2693
fix: don't delete the shared default docker icon when removing an icon-less container#2693chodeus wants to merge 1 commit into
Conversation
…n-less container Containers with no template icon get /plugins/dynamix.docker.manager/images/question.png recorded as their icon in the webui-info registry (DockerClient.php L346). removeContainer() then unlinks that recorded path when cache flags are set, deleting the shared fallback from the docroot for the whole system until the next reboot. CA Docker Auto-Update triggers this whenever it updates an icon-less container. Also quote and guard the container-list onerror fallback (this.onerror=null) so a missing fallback degrades to one failed request per image instead of an endless 404 retry loop. Fixes unraid#2691
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughDocker container cleanup now preserves the shared question icon, and PNG fallback rendering disables repeated ChangesDocker icon safeguards
Estimated code review effort: 2 (Simple) | ~5 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes #2691 — the docker manager deletes its own shared fallback icon (
question.png) whenever an icon-less container is removed or updated with cache flags, and once the file is missing, every icon-less container'sonerrorfallback re-requests it in a tight loop until the next reboot.Changes
include/DockerClient.php(removeContainer()) — skip the icon unlink when the recorded icon is the shared default. Containers with no template icon get/plugins/dynamix.docker.manager/images/question.pngrecorded as their icon (L346), so the existing unlink deleted the shared static file from the docroot for the whole system. Per-container cached icons (<name>-icon.png) are still cleaned up exactly as before.include/DockerContainers.php— quote theonerrorattribute and guard it withthis.onerror=null, so a missing fallback costs one failed request per image instead of an endless 404 retry loop (measured ~150 req/s against nginx with 15 affected images on one open Docker page).Testing (real hardware, per the README workflow)
Tested on Unraid 7.3.2 — both files are byte-identical between 7.3.2 and master at
369f0b2, so the patched master files were copied to the live server directly.php -lclean on both files.removeContainer()via injected webui-info registry entries:cache=2→question.pngsurvives, registry entry cleaned up ✓/state/...-icon.png(file created for the test), removed withcache=1→ cached icon still unlinked, registry entry cleaned up ✓ (registry returned to its original entry count)question.pngtemporarily removed: stock-rendered container images now fail once and stop — previously an endless 404 retry loop. The Docker page renders normally in both states. (The only remaining repeat-requester on my test box traced to a third-party plugin carrying its own copy of the unguardedonerrorpattern.)Summary by CodeRabbit