From d18eaf2364e0c04992c52af38679ff0a0c570440 Mon Sep 17 00:00:00 2001 From: Pujit Mehrotra Date: Fri, 7 Nov 2025 14:52:18 -0500 Subject: [PATCH] fix: detection of flash backup activation state (#1769) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves #1767 plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/UpdateFlashBackup.php:415 still reads the API version from _var($mystatus,'version'), but commit 441e1805c removed the code that populates $mystatus (the parse of /var/local/emhttp/myservers.cfg). As a result $mystatus is undefined, so we now send api_version= to the flash activation endpoint. The PHP runtime also emits “Undefined variable: mystatus” / “Trying to access array offset on value of type null” notices before headers are written. Those notices corrupt the JSON response, the keyserver rejects the request because the api_version is missing, and the flash backup state file is never updated—so the web GUI stays stuck at “Loading”. Because the status request always invokes UpdateFlashBackup.php, every page load trips the same failure path, leaving /var/local/emhttp/flashbackup.ini with loading=Loading. The frontend only listens for /sub/flashbackup events, so until that INI file is rewritten the spinner never clears and the enable button never becomes active. ## Summary by CodeRabbit * **New Features** * UI now initializes flash backup status on page load so backup controls reflect current server state immediately. * Backup state saves now publish remote updates, improving synchronization of backup status. * **Bug Fixes** * Improved API version handling for flash backup operations: sends version when available and falls back gracefully when unknown. --- .../plugins/dynamix.my.servers/Connect.page | 19 ++++++++++++++++++- .../include/UpdateFlashBackup.php | 5 ++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/Connect.page b/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/Connect.page index 5cbce2f90..130da58db 100644 --- a/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/Connect.page +++ b/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/Connect.page @@ -575,12 +575,30 @@ _(Flash backup)_: