A backup archive made before notification channels restores its webhook subscriptions as webhook channels #153

Open
opened 2026-10-31 12:42:16 -04:00 by claude · 0 comments
Owner
  • Draft: PN-15
  • Priority: high (a first-release backup must restore after the upgrade)
  • Agent: coder
  • Depends on: #151
  • Decisions: Q-PN-7, R2-RENAME

Why

Restore reads one required database/<name>.json entry per catalog entry (src/dotnet/src/Ninlil.Dns.Server.Backup/SystemBackupService.cs:254-259). After #151 the entry is NotificationChannels, so a format-1 archive from the first release, which holds WebhookSubscriptions.json, fails as "missing entry". The service already upgrades one older shape on restore (TSIG key links, SystemBackupService.cs:307).

What changes

  • SystemBackupService: when database/NotificationChannels.json is missing and database/WebhookSubscriptions.json is present, parse the legacy entry into NotificationChannelEntity rows with Kind = Webhook, the same Id and the same encrypted credential fields.
  • In the parsed identity relationships, rename claim values webhooks:read/webhooks:write to notifications:read/notifications:write, and webhookdeliverysettings:read/webhookdeliverysettings:write to notificationdeliverysettings:read/notificationdeliverysettings:write.
  • Delivery history is not in backups (BackupEntityCatalog.cs:35), so nothing else changes. CurrentPayloadFormatVersion stays 1: the payload layout did not change, only one entry name.

Acceptance

  • This test fails first: in src/dotnet/tests/Ninlil.Dns.Server.Backup.Tests, Restore_ForAnArchiveWithWebhookSubscriptions_RestoresWebhookChannels builds a format-1 archive with the legacy entry and role claims webhooks:read and webhookdeliverysettings:write, restores it, and finds a Webhook channel with the same id and the claims notifications:read and notificationdeliverysettings:write.
  • A current archive still round-trips.
  • Gate: dotnet test src/dotnet/tests/Ninlil.Dns.Server.Backup.Tests, dotnet test src/dotnet/tests/Ninlil.Web.Tests.

Source

Owner decision 2026-10-31: Q-PN-7; round 2 R2-RENAME.

- **Draft:** PN-15 - **Priority:** high (a first-release backup must restore after the upgrade) - **Agent:** coder - **Depends on:** #151 - **Decisions:** Q-PN-7, R2-RENAME ### Why Restore reads one required `database/<name>.json` entry per catalog entry (`src/dotnet/src/Ninlil.Dns.Server.Backup/SystemBackupService.cs:254-259`). After #151 the entry is `NotificationChannels`, so a format-1 archive from the first release, which holds `WebhookSubscriptions.json`, fails as "missing entry". The service already upgrades one older shape on restore (TSIG key links, `SystemBackupService.cs:307`). ### What changes - `SystemBackupService`: when `database/NotificationChannels.json` is missing and `database/WebhookSubscriptions.json` is present, parse the legacy entry into `NotificationChannelEntity` rows with `Kind = Webhook`, the same `Id` and the same encrypted credential fields. - In the parsed identity relationships, rename claim values `webhooks:read`/`webhooks:write` to `notifications:read`/`notifications:write`, and `webhookdeliverysettings:read`/`webhookdeliverysettings:write` to `notificationdeliverysettings:read`/`notificationdeliverysettings:write`. - Delivery history is not in backups (`BackupEntityCatalog.cs:35`), so nothing else changes. `CurrentPayloadFormatVersion` stays `1`: the payload layout did not change, only one entry name. ### Acceptance - [ ] This test fails first: in `src/dotnet/tests/Ninlil.Dns.Server.Backup.Tests`, `Restore_ForAnArchiveWithWebhookSubscriptions_RestoresWebhookChannels` builds a format-1 archive with the legacy entry and role claims `webhooks:read` and `webhookdeliverysettings:write`, restores it, and finds a `Webhook` channel with the same id and the claims `notifications:read` and `notificationdeliverysettings:write`. - [ ] A current archive still round-trips. - [ ] Gate: `dotnet test src/dotnet/tests/Ninlil.Dns.Server.Backup.Tests`, `dotnet test src/dotnet/tests/Ninlil.Web.Tests`. ### Source Owner decision 2026-10-31: Q-PN-7; round 2 R2-RENAME.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lantea-one/ninlil#153
No description provided.