Skip to content

Raise RedirectsUpdated when a redirect is deleted by id - #195

Open
agunn26 wants to merge 1 commit into
Geta:masterfrom
agunn26:fix/delete-by-id-raises-redirects-updated
Open

agunn26 wants to merge 1 commit into
Geta:masterfrom
agunn26:fix/delete-by-id-raises-redirects-updated

Conversation

@agunn26

@agunn26 agunn26 commented Oct 26, 2026 •

Copy link
Copy Markdown

Fixes #194.

DefaultRedirectsService.DeleteById removed the redirect from the database but, unlike every other write on the service, never raised RedirectsEvents.RedirectsUpdated. The redirects list's Delete button calls it, so CustomRedirectHandler went on serving the deleted redirect until the application restarted or another redirect was added or changed, and OptimizelySyncEvents never relayed the delete to other instances.

Change

  • DeleteById raises RedirectsUpdated after the delete. Like DeleteByOldUrl, it raises it whether or not a row matched.
  • A CHANGELOG entry under [Unreleased]. Renumber it to suit the release.

Tests

  • New DefaultRedirectsServiceTests, the first tests for this service:
    • DeleteById_raises_redirects_updated covers the event that OptimizelySyncEvents relays to other instances.
    • DeleteById_removes_redirect_from_redirect_handler runs the real RedirectsInitializer and CustomRedirectHandler, and checks that the deleted redirect is no longer found.
  • Both fail without the fix. With it, Geta.NotFoundHandler.Tests passes 62/62 on net10.0.

The same change for CMS 12 is in #196, against release/v6.

🤖 Generated with Claude Code

DefaultRedirectsService.DeleteById removed the row but, unlike every
other write on the service, never raised RedirectsEvents.RedirectsUpdated.
The admin redirects list's Delete button calls it, so CustomRedirectHandler
kept serving the deleted redirect until the application restarted or
another redirect was saved, and OptimizelySyncEvents never relayed the
change to other instances.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Deleted redirect keeps redirecting: DeleteById doesn't raise RedirectsUpdated

1 participant