Save and delete works cleanly#7434
Merged
orangewolf merged 1 commit intomainfrom May 8, 2026
Merged
Conversation
Previously, if the redirects feature was enabled but the redirects database table couldn't be queried (most often because the migration hadn't been run yet), saving or deleting a work produced a 500 — even though the work itself had already been saved successfully. This commit catches that error and surfaces it as a clean failure instead. The work save still succeeds; only the redirect bookkeeping is skipped for that request. Redirects are a sidecar to the work, not load-bearing for it, so a soft fail is the right outcome. Also renames "ledger" terminology to "redirects table" throughout the related code and docs for clearer language.
Test Results 17 files ±0 17 suites ±0 3h 24m 16s ⏱️ - 5m 38s Results for commit 0afeda8. ± Comparison against base commit cae6920. This pull request removes 436 and adds 438 tests. Note that renamed tests count towards both. |
orangewolf
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Details
When a tenant has the redirects feature enabled but the migration that creates the redirects database table hasn't been run, the redirects sync/remove steps were letting the database error escape, producing a 500 — even though the work itself had already saved successfully. The user was left looking at a stack trace with no clear recovery path.
This change has the sync and remove steps catch that error, log it, and return a clean failure to the controller instead. Redirects are a sidecar to the work, not load-bearing for it, so a soft fail is the right outcome: the work save still succeeds, and only the redirect bookkeeping is skipped for that request.
The issue surfaced during early Hyku integration testing when the migration hadn't been installed yet.
The primary fixes are in:
The remainder of changes are in specs and documentation. As this change would have introduced several more locations of using either "ledger" and "redirects table" with the same meaning, it renames "ledger" terminology to "redirects table" throughout the related code and docs for clearer language.
Testing