Skip to content

feat(api): add patch endpoint to update issuer label#5472

Merged
akrem-chabchoub merged 4 commits into
masterfrom
feat/postage-label-update
Jun 12, 2026
Merged

feat(api): add patch endpoint to update issuer label#5472
akrem-chabchoub merged 4 commits into
masterfrom
feat/postage-label-update

Conversation

@akrem-chabchoub

@akrem-chabchoub akrem-chabchoub commented May 21, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

Adds a PATCH /stamps/{batch_id} endpoint that lets a node operator update the label of an existing postage batch issuer. The label is local metadata only, it has no on-chain effect and requires no transaction. The change is persisted to the stamp store so it survives node restarts.

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

AI Disclosure

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

@akrem-chabchoub akrem-chabchoub self-assigned this May 21, 2026
@akrem-chabchoub akrem-chabchoub added this to the 2026 milestone May 21, 2026
@akrem-chabchoub akrem-chabchoub linked an issue May 21, 2026 that may be closed by this pull request
3 tasks
@akrem-chabchoub akrem-chabchoub changed the title Feat/postage label update feat(api): add patch endpoint to update issuer label May 21, 2026
@akrem-chabchoub akrem-chabchoub marked this pull request as ready for review June 9, 2026 12:41

@gacevicljubisa gacevicljubisa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks ok.
Maybe you can consider adding TestUpdateIssuerLabel on the postage service level which will cover ErrNotFound, and the in-memory update

Comment thread pkg/postage/service.go

for _, st := range ps.issuers {
if bytes.Equal(batchID, st.data.BatchID) {
st.data.Label = label

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is data race on data.Label when we have concurent GET + PATCH on the same batch.

@akrem-chabchoub akrem-chabchoub merged commit 9631202 into master Jun 12, 2026
15 checks passed
@akrem-chabchoub akrem-chabchoub deleted the feat/postage-label-update branch June 12, 2026 13:40
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.

Allow renaming (relabelling) postage batches

3 participants