Allow re-delivery after a release has been deleted#16
Merged
Conversation
A NewReleaseMessage for a previously deleted release was bouncing back to Deleted: the no-deal-as-takedown rule fired against the stale entityId, and pgUpsert/omitEmpty never cleared the published-entity fields, so the worker re-ran deleteRelease against the dead entity. Skip the takedown rewrite and null the entity pointers when the prior row is Deleted so the publisher takes the create path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 tasks
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
NewReleaseMessagefor a release inDeletedstate was bouncing back toDeleted: the no-deal-as-takedown rule fired against the staleentityId, andpgUpsert+omitEmptynever cleared the published-entity fields, so the worker re-randeleteReleaseagainst the dead entity.entityId/ old user, silently failing.prior.status == Deleted, skip the takedown rewrite and explicitly nullentityId,entityType,blockHash,blockNumber,publishedAt,mediaDeletedAt, and the publish-error counters so the worker takes the create path.Caveat
audiusUseris not cleared on the deleted-row reset. If the re-delivery is meant to land under a different account, the new XML still needs to either resolve to that user viauserRepo.matchor setaudiusUserexplicitly — otherwise the old user gets the new entity.Test plan
tsc --noEmitpassesmake test— couldn't run locally (test Postgres container failed to start, no disk space); please run before mergingsrc/parseTakedown.test.tscovers: deliver → publish → takedown → Deleted → re-deliver should land onPublishPendingwith clearedentityId/entityType/publishedAt🤖 Generated with Claude Code