[PR #247] [MERGED] Fix: Autosync disable functionality and multiple instance issues #293

Open
opened 2025-11-20 04:16:14 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE-Local/pull/247
Author: @michelroegl-brunner
Created: 10/24/2025
Status: Merged
Merged: 10/24/2025
Merged by: @michelroegl-brunner

Base: mainHead: fix/script-card-click-issues


📝 Commits (10+)

  • 2c3fdf5 Fix script card click issues and missing Install button
  • b40f5b7 Fix script downloader placeholder files issue
  • 6c98205 Fix notification to show script names grouped by category
  • e40bd1f Fix CT script source line replacement
  • 9a8cff3 Add missing checkScriptExists method to scriptDownloader.js
  • 8fc9b27 Fix missing access import in scriptDownloader.js
  • 926032e Fix auto-sync service not stopping when disabled
  • 5acaf14 Fix autosync toggle disable functionality
  • fdeda6c Add GitHub token authentication to sync services
  • 7b4daf8 Fix autosync continuing to run after being disabled

📊 Changes

35 files changed (+2242 additions, -1902 deletions)

View changed files

📝 .env.example (+9 -0)
📝 scripts/json/bunkerweb.json (+1 -1)
scripts/json/execute.json (+48 -0)
📝 scripts/json/glpi.json (+1 -1)
📝 scripts/json/guardian.json (+1 -1)
📝 scripts/json/jellyfin.json (+1 -1)
scripts/json/jotty.json (+40 -0)
📝 scripts/json/kavita.json (+1 -1)
📝 scripts/json/metadata.json (+185 -185)
📝 scripts/json/mysql.json (+1 -1)
📝 scripts/json/nextcloudpi.json (+1 -1)
📝 scripts/json/odoo.json (+1 -1)
📝 scripts/json/omv.json (+1 -1)
scripts/json/open-archiver.json (+40 -0)
📝 scripts/json/openwebui.json (+1 -1)
📝 scripts/json/paperless-ai.json (+2 -2)
📝 scripts/json/tautulli.json (+1 -1)
📝 scripts/json/technitiumdns.json (+1 -1)
📝 scripts/json/undefined.json (+450 -450)
📝 scripts/json/versions.json (+796 -696)

...and 15 more files

📄 Description

🐛 Fix: Autosync Disable Functionality and Multiple Instance Issues

Problem

The autosync feature had several critical issues:

  1. Autosync continued running after being disabled - The toggle in GUI would show disabled but autosync would keep executing
  2. Multiple autosync instances running simultaneously - Causing 6+ notifications and rate limit errors
  3. Cron jobs not properly destroyed - Only stopped but not destroyed, allowing continued execution
  4. GitHub API rate limit errors - No token authentication and poor error handling

Root Causes

  • 's method only stops current execution but doesn't destroy the scheduled job
  • Multiple service instances being created without proper cleanup
  • No global lock to prevent concurrent autosync execution
  • Missing GitHub token authentication in sync services
  • Poor error handling for rate limit scenarios

Solution

🔧 Core Fixes

  • Added method to properly remove cron jobs from scheduler
  • Implemented global lock system to prevent multiple autosync instances
  • Enhanced safety checks in cron job execution with multiple validation layers
  • Added GitHub token authentication to all sync services
  • Improved error handling with specific rate limit error detection

🛠️ Technical Changes

AutoSyncService ():

  • Added to prevent concurrent execution
  • Enhanced to call both and
  • Added multiple safety checks in cron job execution
  • Improved error handling with detection
  • Added proper TypeScript type definitions

GitHub Services:

  • Added GitHub token authentication to and
  • Enhanced error handling for 403 rate limit responses
  • Better error messages for users

API Routes:

  • Fixed validation fallback for custom cron expressions
  • Enhanced error reporting in autosync settings API
  • Proper global service instance management

Frontend:

  • Added auto-save functionality for autosync toggle
  • Better error handling for API validation errors
  • Enhanced UI feedback for autosync status

🧪 Testing

  • Autosync properly stops when disabled
  • No more multiple notifications (was 6+, now 1)
  • No more concurrent autosync instances
  • GitHub token authentication working
  • Proper error reporting for rate limits
  • All TypeScript linting errors resolved

📝 Commit History

  • 16947ce - Remove debug logs from autosync service
  • eca0cb5 - Fix TypeScript linting errors in autoSyncService
  • 011cbd2 - Fix autosync continuing to run after being disabled
  • 19e18b4 - Fix multiple autosync instances running simultaneously
  • ffef631 - Add error reporting for GitHub rate limit errors
  • 7b4daf8 - Fix autosync continuing to run after being disabled
  • fdeda6c - Add GitHub token authentication to sync services
  • 5acaf14 - Fix autosync toggle disable functionality
  • 926032e - Fix auto-sync service not stopping when disabled

🎯 Impact

  • User Experience: Autosync now properly respects the disable setting
  • Performance: Eliminated multiple concurrent instances and spam notifications
  • Reliability: Better error handling and GitHub API rate limit management
  • Maintainability: Cleaner code with proper TypeScript types

Fixes autosync disable functionality and resolves multiple instance issues that were causing spam notifications and rate limit errors.


🔄 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/247 **Author:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Created:** 10/24/2025 **Status:** ✅ Merged **Merged:** 10/24/2025 **Merged by:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Base:** `main` ← **Head:** `fix/script-card-click-issues` --- ### 📝 Commits (10+) - [`2c3fdf5`](https://github.com/community-scripts/ProxmoxVE-Local/commit/2c3fdf5544c55308918707eaa9c93c989e1f4327) Fix script card click issues and missing Install button - [`b40f5b7`](https://github.com/community-scripts/ProxmoxVE-Local/commit/b40f5b788c16b4071f569173bc5748410313e680) Fix script downloader placeholder files issue - [`6c98205`](https://github.com/community-scripts/ProxmoxVE-Local/commit/6c982050dadadaf4169ce19f9f81ea0faf8eb766) Fix notification to show script names grouped by category - [`e40bd1f`](https://github.com/community-scripts/ProxmoxVE-Local/commit/e40bd1f6a39c1af4e82b1f2e08e3d5f40fa7e337) Fix CT script source line replacement - [`9a8cff3`](https://github.com/community-scripts/ProxmoxVE-Local/commit/9a8cff32273ce1492cb65ff099159a0d646847f8) Add missing checkScriptExists method to scriptDownloader.js - [`8fc9b27`](https://github.com/community-scripts/ProxmoxVE-Local/commit/8fc9b27f559fbb354bc8c05b7da101d7947459ee) Fix missing access import in scriptDownloader.js - [`926032e`](https://github.com/community-scripts/ProxmoxVE-Local/commit/926032e83b6334f4551d52d08a246f75da251c64) Fix auto-sync service not stopping when disabled - [`5acaf14`](https://github.com/community-scripts/ProxmoxVE-Local/commit/5acaf144fbb9e234d5991ed9f7d1b8f1c494d3e8) Fix autosync toggle disable functionality - [`fdeda6c`](https://github.com/community-scripts/ProxmoxVE-Local/commit/fdeda6c77a14199c63ea9d8159aec21b7008f816) Add GitHub token authentication to sync services - [`7b4daf8`](https://github.com/community-scripts/ProxmoxVE-Local/commit/7b4daf87544b2d91cfdbbbcf9cf6ddf261b6ded4) Fix autosync continuing to run after being disabled ### 📊 Changes **35 files changed** (+2242 additions, -1902 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+9 -0) 📝 `scripts/json/bunkerweb.json` (+1 -1) ➕ `scripts/json/execute.json` (+48 -0) 📝 `scripts/json/glpi.json` (+1 -1) 📝 `scripts/json/guardian.json` (+1 -1) 📝 `scripts/json/jellyfin.json` (+1 -1) ➕ `scripts/json/jotty.json` (+40 -0) 📝 `scripts/json/kavita.json` (+1 -1) 📝 `scripts/json/metadata.json` (+185 -185) 📝 `scripts/json/mysql.json` (+1 -1) 📝 `scripts/json/nextcloudpi.json` (+1 -1) 📝 `scripts/json/odoo.json` (+1 -1) 📝 `scripts/json/omv.json` (+1 -1) ➕ `scripts/json/open-archiver.json` (+40 -0) 📝 `scripts/json/openwebui.json` (+1 -1) 📝 `scripts/json/paperless-ai.json` (+2 -2) 📝 `scripts/json/tautulli.json` (+1 -1) 📝 `scripts/json/technitiumdns.json` (+1 -1) 📝 `scripts/json/undefined.json` (+450 -450) 📝 `scripts/json/versions.json` (+796 -696) _...and 15 more files_ </details> ### 📄 Description ## 🐛 Fix: Autosync Disable Functionality and Multiple Instance Issues ### Problem The autosync feature had several critical issues: 1. **Autosync continued running after being disabled** - The toggle in GUI would show disabled but autosync would keep executing 2. **Multiple autosync instances running simultaneously** - Causing 6+ notifications and rate limit errors 3. **Cron jobs not properly destroyed** - Only stopped but not destroyed, allowing continued execution 4. **GitHub API rate limit errors** - No token authentication and poor error handling ### Root Causes - 's method only stops current execution but doesn't destroy the scheduled job - Multiple service instances being created without proper cleanup - No global lock to prevent concurrent autosync execution - Missing GitHub token authentication in sync services - Poor error handling for rate limit scenarios ### Solution #### 🔧 Core Fixes - **Added method** to properly remove cron jobs from scheduler - **Implemented global lock system** to prevent multiple autosync instances - **Enhanced safety checks** in cron job execution with multiple validation layers - **Added GitHub token authentication** to all sync services - **Improved error handling** with specific rate limit error detection #### 🛠️ Technical Changes **AutoSyncService ()**: - Added to prevent concurrent execution - Enhanced to call both and - Added multiple safety checks in cron job execution - Improved error handling with detection - Added proper TypeScript type definitions **GitHub Services**: - Added GitHub token authentication to and - Enhanced error handling for 403 rate limit responses - Better error messages for users **API Routes**: - Fixed validation fallback for custom cron expressions - Enhanced error reporting in autosync settings API - Proper global service instance management **Frontend**: - Added auto-save functionality for autosync toggle - Better error handling for API validation errors - Enhanced UI feedback for autosync status ### 🧪 Testing - ✅ Autosync properly stops when disabled - ✅ No more multiple notifications (was 6+, now 1) - ✅ No more concurrent autosync instances - ✅ GitHub token authentication working - ✅ Proper error reporting for rate limits - ✅ All TypeScript linting errors resolved ### 📝 Commit History - `16947ce` - Remove debug logs from autosync service - `eca0cb5` - Fix TypeScript linting errors in autoSyncService - `011cbd2` - Fix autosync continuing to run after being disabled - `19e18b4` - Fix multiple autosync instances running simultaneously - `ffef631` - Add error reporting for GitHub rate limit errors - `7b4daf8` - Fix autosync continuing to run after being disabled - `fdeda6c` - Add GitHub token authentication to sync services - `5acaf14` - Fix autosync toggle disable functionality - `926032e` - Fix auto-sync service not stopping when disabled ### 🎯 Impact - **User Experience**: Autosync now properly respects the disable setting - **Performance**: Eliminated multiple concurrent instances and spam notifications - **Reliability**: Better error handling and GitHub API rate limit management - **Maintainability**: Cleaner code with proper TypeScript types Fixes autosync disable functionality and resolves multiple instance issues that were causing spam notifications and rate limit errors. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 04:16:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: saavagebueno/ProxmoxVE-Local#293