Skip to content

fix(cms): guard default banner unset - #197

Merged
damianrzepka merged 4 commits into
devfrom
fix/banner-unset-schedule-guard
Sep 19, 2026
Merged

damianrzepka merged 4 commits into
devfrom
fix/banner-unset-schedule-guard

Conversation

@damianrzepka

Copy link
Copy Markdown
Collaborator

Summary

Prevents a placement default from being unset while an active or future banner schedule depends on it. Serializes the default-unset and schedule-create operations with the placement schedule lock.

Why

A concurrent schedule creation could otherwise succeed after the default had been removed, leaving the schedule without its fallback banner.

Alternatives considered

A client-side check cannot make this invariant safe because another administrator can change schedules after the check. The service-level transactional guard is the shared enforcement point.

Risks

The migration adds an index on schedule end time. Deploy migrations before application instances that use the guard.

@jakubfilinger-b jakubfilinger-b left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocker: an expired schedule can be revived after the default is cleared, so the end-date update path must preserve the fallback invariant.

Comment thread packages/core/src/cms/service/cms.service.ts
@damianrzepka
damianrzepka merged commit ea1286b into dev Sep 19, 2026
2 checks passed
@damianrzepka
damianrzepka deleted the fix/banner-unset-schedule-guard branch September 19, 2026 10:19
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.

2 participants