Fix compliments module bringing mirror to a halt (#3402)

... when no compliments are to be displayed. We shouldnt even try to
randomize when the array has no elements...

Fixes #3385
This commit is contained in:
Veeck 2024-03-23 12:16:57 +01:00 committed by GitHub
parent 52cfbacd4d
commit 57549fa19c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View File

@ -40,11 +40,12 @@ _This release is scheduled to be released on 2024-04-01._
- Ignore all custom css files (#3359) - Ignore all custom css files (#3359)
- [newsfeed] Fix newsfeed stall issue introduced by #3336 (#3361) - [newsfeed] Fix newsfeed stall issue introduced by #3336 (#3361)
- Changed `log.debug` to `log.log` in `app.js` where logLevel is not set because config is not loaded at this time (#3353) - Changed `log.debug` to `log.log` in `app.js` where logLevel is not set because config is not loaded at this time (#3353)
- [calandar] deny fetch interval < 60000 and set 60000 in this case (prevent fetch loop failed) (#3382) - [calendar] deny fetch interval < 60000 and set 60000 in this case (prevent fetch loop failed) (#3382)
- added message in case where config.js is missing the module.export line PR #3383 - added message in case where config.js is missing the module.export line PR #3383
- Fixed an issue where recurring events could extend past their recurrence end date (#3393) - Fixed an issue where recurring events could extend past their recurrence end date (#3393)
- Don't display any `npm WARN <....>` on install (#3399) - Don't display any `npm WARN <....>` on install (#3399)
- Fixed move suncalc dependency to production from dev, as it is used by clock module - Fixed move suncalc dependency to production from dev, as it is used by clock module
- [compliments] Fix mirror not responding anymore when no compliments are to be shown (#3385)
### Deleted ### Deleted
@ -94,7 +95,7 @@ This release also marks the latest release by Michael Teeuw. For more info, plea
- Fix #3256 filter out bad results from rrule.between - Fix #3256 filter out bad results from rrule.between
- Fix calendar events sometimes not respecting deleted events (#3250) - Fix calendar events sometimes not respecting deleted events (#3250)
- Fix electron loadurl locally on Windows when address "0.0.0.0" (#2550) - Fix electron loadurl locally on Windows when address "0.0.0.0" (#2550)
- Fix updatanotification (update_helper.js): catch error if reponse is not an JSON format (check PM2) - Fix updatanotification (update_helper.js): catch error if response is not an JSON format (check PM2)
- Fix missing typeof in calendar module - Fix missing typeof in calendar module
- Fix style issues after prettier update - Fix style issues after prettier update
- Fix calendar test (#3291) by moving "Exdate check" from e2e to electron to run on a Thursday - Fix calendar test (#3291) by moving "Exdate check" from e2e to electron to run on a Thursday
@ -169,8 +170,8 @@ Special thanks to @khassel, @rejas and @sdetweil for taking over most (if not al
- Added tests for serveronly - Added tests for serveronly
- Set Timezone `Europe/Berlin` in unit tests (needed for new formatTime tests) - Set Timezone `Europe/Berlin` in unit tests (needed for new formatTime tests)
- Added no-param-reassign eslint rule and fix warnings - Added no-param-reassign eslint rule and fix warnings
- updatenotification: Added `sendUpdatesNotifications` feature. Broadcast update with `UPDATES` notification to other modules - [updatenotification] Added `sendUpdatesNotifications` feature. Broadcast update with `UPDATES` notification to other modules
- updatenotification: allow force scanning with `SCAN_UPDATES` notification from other modules - [updatenotification] Allow force scanning with `SCAN_UPDATES` notification from other modules
- Added per-calendar fetchInterval - Added per-calendar fetchInterval
### Removed ### Removed

View File

@ -50,7 +50,7 @@ Module.register("compliments", {
* @returns {number} a random index of given array * @returns {number} a random index of given array
*/ */
randomIndex (compliments) { randomIndex (compliments) {
if (compliments.length === 1) { if (compliments.length <= 1) {
return 0; return 0;
} }