[PR #348] [MERGED] fix: Detect script changes from remote repository to allow Script updates #379

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

📋 Pull Request Information

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

Base: mainHead: fix/update_script


📝 Commits (2)

  • 577b965 package-lock.json
  • 5d5eba7 fix: detect script changes from remote repository

📊 Changes

3 files changed (+90 additions, -37 deletions)

View changed files

📝 package-lock.json (+0 -14)
📝 src/app/_components/ScriptDetailModal.tsx (+58 -13)
📝 src/server/services/scriptDownloader.js (+32 -10)

📄 Description

Problem

When a user loads a script from the default repo, it works fine. However, when the script changes in the remote repository (GitHub), the user doesn't get notified and cannot update. This happens because:

  1. The compareScriptContent query is cached by React Query (default staleTime: 30s)
  2. When the modal reopens, it uses cached comparison results instead of checking the remote repository for changes
  3. The comparison logic correctly downloads fresh content from GitHub, but the query cache prevents it from running

Solution

  • Added refetchOnMount: true and staleTime: 0 to compareScriptContent query to bypass React Query cache
  • Added visible refresh button in script detail modal to manually check for updates
  • Improved comparison error handling and logging for better debugging
  • Display error messages in UI when comparison fails

Changes

  • src/app/_components/ScriptDetailModal.tsx: Updated query options and added refresh button
  • src/server/services/scriptDownloader.js: Added comprehensive logging and improved error handling

🔄 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/348 **Author:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Created:** 11/26/2025 **Status:** ✅ Merged **Merged:** 11/26/2025 **Merged by:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Base:** `main` ← **Head:** `fix/update_script` --- ### 📝 Commits (2) - [`577b965`](https://github.com/community-scripts/ProxmoxVE-Local/commit/577b96518e96513e6e767c8af043b35a85a95c1f) package-lock.json - [`5d5eba7`](https://github.com/community-scripts/ProxmoxVE-Local/commit/5d5eba72de682a796b4a9adb6ad4b9fa935ae0e3) fix: detect script changes from remote repository ### 📊 Changes **3 files changed** (+90 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `package-lock.json` (+0 -14) 📝 `src/app/_components/ScriptDetailModal.tsx` (+58 -13) 📝 `src/server/services/scriptDownloader.js` (+32 -10) </details> ### 📄 Description ## Problem When a user loads a script from the default repo, it works fine. However, when the script changes in the remote repository (GitHub), the user doesn't get notified and cannot update. This happens because: 1. The `compareScriptContent` query is cached by React Query (default `staleTime: 30s`) 2. When the modal reopens, it uses cached comparison results instead of checking the remote repository for changes 3. The comparison logic correctly downloads fresh content from GitHub, but the query cache prevents it from running ## Solution - Added `refetchOnMount: true` and `staleTime: 0` to `compareScriptContent` query to bypass React Query cache - Added visible refresh button in script detail modal to manually check for updates - Improved comparison error handling and logging for better debugging - Display error messages in UI when comparison fails ## Changes - `src/app/_components/ScriptDetailModal.tsx`: Updated query options and added refresh button - `src/server/services/scriptDownloader.js`: Added comprehensive logging and improved error handling --- <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:11 +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#379
No description provided.