Skip to content

Allow re-delivery after a release has been deleted#16

Merged
raymondjacobson merged 1 commit into
mainfrom
fix-redeliver-after-takedown
May 19, 2026
Merged

Allow re-delivery after a release has been deleted#16
raymondjacobson merged 1 commit into
mainfrom
fix-redeliver-after-takedown

Conversation

@raymondjacobson
Copy link
Copy Markdown
Member

Summary

  • A NewReleaseMessage for a release in Deleted state 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.
  • When the new delivery did carry deals, the worker still routed to the update path against the dead entityId / old user, silently failing.
  • Fix: when prior.status == Deleted, skip the takedown rewrite and explicitly null entityId, entityType, blockHash, blockNumber, publishedAt, mediaDeletedAt, and the publish-error counters so the worker takes the create path.

Caveat

  • audiusUser is 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 via userRepo.match or set audiusUser explicitly — otherwise the old user gets the new entity.

Test plan

  • tsc --noEmit passes
  • make test — couldn't run locally (test Postgres container failed to start, no disk space); please run before merging
  • New case in src/parseTakedown.test.ts covers: deliver → publish → takedown → Deleted → re-deliver should land on PublishPending with cleared entityId/entityType/publishedAt

🤖 Generated with Claude Code

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>
@raymondjacobson raymondjacobson merged commit 6903e6e into main May 19, 2026
1 check passed
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.

1 participant