Skip to content

fix(backups): allow on-demand creds for not-scheduled types#283

Merged
passcod merged 1 commit into
mainfrom
backups-ondemand-not-scheduled
Jun 26, 2026
Merged

fix(backups): allow on-demand creds for not-scheduled types#283
passcod merged 1 commit into
mainfrom
backups-ondemand-not-scheduled

Conversation

@passcod

@passcod passcod commented Jun 26, 2026

Copy link
Copy Markdown
Member

🤖 The /backup-credentials issuance gate rejected any backup type whose server_backup_capabilities row wasn't enabled. But enabled only means "on the auto-schedule": the admin UI offers Backup now for declared-but-disabled types (the "not scheduled" chip explicitly says on-demand still works), and the heartbeat (backups_due_now_for_server) surfaces those one-off requests to the device regardless of enabled. The device then hit a 409 when fetching credentials, so a manually-requested backup of a not-scheduled type could never run.

Fix

The issuance gate now mirrors exactly what the heartbeat is willing to ask the device to run: issue credentials when the type is enabled, or when a request of the matching purpose is pending.

  • BackupRequest::exists(server, type, purpose) — new DB helper.
  • require_enabled_capabilityrequire_issuable_capability, now takes purpose and checks enabled || pending request.
  • Regenerated the public-server OpenAPI spec (field doc-comment changed).

This doesn't loosen scheduled backups — the scheduler still gates on enabled, and an enabled type still works for any purpose.

Tag: TAM-6877

The /backup-credentials issuance gate rejected any backup type whose
server_backup_capabilities row wasn't enabled. But 'enabled' only means
'on the auto-schedule': the UI offers 'Backup now' for declared-but-disabled
types (the 'not scheduled' chip explicitly says on-demand still works), and
the heartbeat surfaces those one-off requests to the device regardless of
enabled. The device then hit a 409 when fetching creds.

Gate now mirrors what the heartbeat is willing to ask for: issue when the
type is enabled, or when a request of the matching purpose is pending.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@passcod passcod added this pull request to the merge queue Jun 26, 2026
Merged via the queue into main with commit e4f4a6f Jun 26, 2026
7 checks passed
@passcod passcod deleted the backups-ondemand-not-scheduled branch June 26, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant