[PR #316] [MERGED] Fix script slug matching to prevent false positives #353

Closed
opened 2026-02-26 12:41:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE-Local/pull/316
Author: @michelroegl-brunner
Created: 11/13/2025
Status: Merged
Merged: 11/13/2025
Merged by: @michelroegl-brunner

Base: mainHead: fix/310


📝 Commits (1)

  • a45f9ae Fix script slug matching to prevent false positives

📊 Changes

2 files changed (+22 additions, -10 deletions)

View changed files

📝 src/app/_components/DownloadedScriptsTab.tsx (+11 -5)
📝 src/app/_components/ScriptsGrid.tsx (+11 -5)

📄 Description

Problem

Downloaded scripts were incorrectly matched using normalized name matching, causing scripts with similar slugs (like 'docker-vm') to appear when loading a different script (like 'docker').

Root Cause

The matching logic used normalized slug/name matching as a fallback, which could cause false matches. For example, when only ct/docker.sh was downloaded, the system would incorrectly show docker-vm as downloaded.

Solution

  • Removed the problematic normalized slug/name matching fallback
  • Use exact slug-to-slug matching as the primary method
  • Only use install basename matching for edge cases where install script names differ from slugs
  • This ensures only exact matches are allowed, preventing substring/starts-with false matches

Testing

  • Load script with slug 'docker'
  • Ensure 'docker-vm' does not appear in downloaded scripts list
  • Only scripts with exact slug matches should appear

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE-Local/pull/316 **Author:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Created:** 11/13/2025 **Status:** ✅ Merged **Merged:** 11/13/2025 **Merged by:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Base:** `main` ← **Head:** `fix/310` --- ### 📝 Commits (1) - [`a45f9ae`](https://github.com/community-scripts/ProxmoxVE-Local/commit/a45f9ae5e662241ae6f369455bf3f8709ebb166b) Fix script slug matching to prevent false positives ### 📊 Changes **2 files changed** (+22 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/app/_components/DownloadedScriptsTab.tsx` (+11 -5) 📝 `src/app/_components/ScriptsGrid.tsx` (+11 -5) </details> ### 📄 Description ## Problem Downloaded scripts were incorrectly matched using normalized name matching, causing scripts with similar slugs (like 'docker-vm') to appear when loading a different script (like 'docker'). ## Root Cause The matching logic used normalized slug/name matching as a fallback, which could cause false matches. For example, when only `ct/docker.sh` was downloaded, the system would incorrectly show `docker-vm` as downloaded. ## Solution - Removed the problematic normalized slug/name matching fallback - Use exact slug-to-slug matching as the primary method - Only use install basename matching for edge cases where install script names differ from slugs - This ensures only exact matches are allowed, preventing substring/starts-with false matches ## Testing - Load script with slug 'docker' - Ensure 'docker-vm' does not appear in downloaded scripts list - Only scripts with exact slug matches should appear --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 12:41:06 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE-Local#353
No description provided.