case 4763 - backup sets to keep must be at least 1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 16:11:20 -07:00
parent c52273f284
commit 393a60c57d
4 changed files with 16 additions and 5 deletions

View File

@@ -20,6 +20,7 @@ IN PROGRESS
- Server: in some cases opening a record that has since been deleted (for example from an old link) gave a server error, and a report printed for records of which some had since been deleted failed; it now shows a "not found" message, and the report prints the remaining records.
- Server: in some cases deleting a record that is still in use elsewhere (for example a customer, unit, part or rate used on a work order, quote or PM) gave a server error; it now always says which kind of record is using it.
- Server: the server log now records the next automatic backup time (or that automatic backup is off) each time the server starts.
- Backup: the [number of backups to keep](ops-form-backup.md#number-of-backups-to-keep) can no longer be set below 1; a setting of 0 already kept the most recent backup, the same as 1.
### AyaNova 8.3.0

View File

@@ -158,7 +158,7 @@ Checking this box will cause AyaNova to also back up the attached files in addit
_AyaNova Subscription service keeps one backup by default and this option is not available_
The backup system will automatically remove old backups depending upon this setting. If it is set to 3 then the most recent three backups are kept.
The backup system will automatically remove old backups depending upon this setting. If it is set to 3 then the most recent three backups are kept. The minimum is 1: the most recent backup is always kept.
If you are following the disaster recovery best practice policy of 10 backup rotation as [suggested above](#10-backup-rotation) then you would only need to keep 1 current backup set.

View File

@@ -79,9 +79,15 @@ namespace AyaNova.Api.Controllers
GlobalOpsBackupSettingsBiz biz = GlobalOpsBackupSettingsBiz.GetBiz(ct, HttpContext);
if (!Authorized.HasModifyRole(HttpContext.Items, biz.BizType))
return StatusCode(403, new ApiNotAuthorizedResponse());
var o = await biz.PutAsync(updatedObject);
var o = await biz.PutAsync(updatedObject);
if (o == null)
return StatusCode(409, new ApiErrorResponse(biz.Errors));
{
//case 4763: the settings can now fail validation, which is not a concurrency conflict
if (biz.Errors.Exists(z => z.Code == ApiErrorCode.CONCURRENCY_CONFLICT))
return StatusCode(409, new ApiErrorResponse(biz.Errors));
else
return BadRequest(new ApiErrorResponse(biz.Errors));
}
return Ok(ApiOkResponse.Response(new { Concurrency = o.Concurrency }));
}

View File

@@ -112,8 +112,12 @@ namespace AyaNova.Biz
//Can save or update?
private void Validate(GlobalOpsBackupSettings inObj)
{
//currently nothing to validate
#if (!SUBSCRIPTION_BUILD)
//case 4763: at least the newest backup is always kept, so fewer than 1 is not a setting (it was treated as 1)
//the subscription build always keeps 1 and its form doesn't show this setting
if (inObj.BackupSetsToKeep < 1)
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "BackupSetsToKeep");
#endif
}