Skip to content

fix: back off invalid metadata jobs and stop re-mints from wiping token metadata - #360

Merged
rafa-stacks merged 2 commits into
mainfrom
fix-invalid
Aug 28, 2026
Merged

fix: back off invalid metadata jobs and stop re-mints from wiping token metadata#360
rafa-stacks merged 2 commits into
mainfrom
fix-invalid

Conversation

@rafa-stacks

@rafa-stacks rafa-stacks commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

A token's job row is re-enqueued as pending on every re-mint (the JSON behind a token URI can be fixed without the contract ever changing). But updateJobStatus cleared retry_after for any non-pending status, so a job that had just been marked invalid was pickable again the instant the next mint landed.

Now a UserError sets retry_after = NOW() + JOB_QUEUE_INVALID_RETRY_AFTER_MS (new env var, default 1h).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds invalid-job backoff and preserves token metadata during re-mints.

Changes:

  • Adds configurable invalid-job retry delay.
  • Preserves fetched metadata when re-enqueuing minted tokens.
  • Adds queue and SFT re-mint regression tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/env.ts Defines the invalid-job backoff setting.
src/pg/stacks-core-pg-store.ts Preserves metadata and schedules invalid-job retries.
src/token-processor/queue/job/job.ts Applies backoff after user errors.
tests/token-queue/job.test.ts Tests invalid-job backoff.
tests/stacks-core/sft-events.test.ts Tests metadata preservation after re-minting.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/pg/stacks-core-pg-store.ts Outdated
Comment thread tests/token-queue/job.test.ts
Comment thread src/env.ts
@rafa-stacks
rafa-stacks marked this pull request as ready for review August 28, 2026 15:38
@rafa-stacks
rafa-stacks merged commit 883553c into main Aug 28, 2026
10 checks passed
@rafa-stacks
rafa-stacks deleted the fix-invalid branch August 28, 2026 15:58
@github-project-automation github-project-automation Bot moved this to ✅ Done in API Board Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants