Added warning for old version of Homebridge UI #200
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


♻️ Current situation
When running on an older version of Homebridge UI, the call to get ignored plugins fails with ERR_BAD_REQUEST error, as there is only a PUT endpoint and no GET endpoint.
💡 Proposed solution
The best solution going forward is to catch ERR_BAD_REQUEST errors and if they are generated as a response to the call to get ignored plugins, then output a warning to the logs that this functionality requires a newer version of Homebridge UI and the user should update.
⚙️ Release Notes
This code fix should be accompanied by a warning on the UI that ignoring updates for ignored plugins will not work on older versions of Homebridge UI and the and the user should update to the latest version if they want to use this feature.
➕ Additional Information
Logs as currently output by Homebridge UI v5.4.1:
This PR addresses issue #199 - 🐞 Bug: ERR_BAD_REQUEST error connecting to http://localhost:8581/api/config-editor/ui/plugins/hide-updates-for