feat: send status update notification to buyer on order status change#19
Merged
eurobuddha merged 1 commit intomasterfrom Mar 23, 2026
Merged
Conversation
… change
When the vendor changes an order status in the inbox, a ChainMail
on-chain message (type: STATUS_UPDATE) is silently encrypted and sent
to the buyer via the existing MINIMERCH_ADDRESS mechanism.
Inbox (app.js):
- New sendStatusUpdateToBuyer(msg, newStatus, btn) function — encrypts
payload {type, randomid, ref, status, vendorPublicKey} and sends via
MDS to MINIMERCH_ADDRESS; updates button text to reflect outcome
- setupStatusUpdateListener() calls sendStatusUpdateToBuyer after DB
update succeeds; button shows "✓ Updated · Buyer notified" on success
- MDS_PENDING handler extended to match pendingStatusUpdateUid so
wallet-approval flow is handled correctly
- Added pendingStatusUpdateData/Uid globals
Shop (app.js, service.js):
- processReplyMessage() and processDecryptedMessage() now also handle
STATUS_UPDATE type (previously filtered out as unknown)
- STATUS_UPDATE stored as received message with subject/message derived
from the status value
- renderMessageList() shows status emoji icon and "Status Update" label
- renderMessageDetail() shows a dedicated STATUS_UPDATE detail view with
order ref, new status, timestamp, and mark-as-read button
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
STATUS_UPDATE) is encrypted and sent to the buyer using the existing MINIMERCH_ADDRESS messaging mechanism✓ Updated · Buyer notified,✓ Updated · Pending approval, or plain✓ Updatedon send failure (DB update always succeeds regardless)Changes
template/inbox/app.jssendStatusUpdateToBuyer(msg, newStatus, btn)— encrypts{type: STATUS_UPDATE, randomid, ref, status, vendorPublicKey}and sends to MINIMERCH_ADDRESS; handles pending approval flowsetupStatusUpdateListener()calls it after successful DB updateMDS_PENDINGhandler extended forpendingStatusUpdateUidtemplate/shop/app.jsprocessReplyMessage()extended to handleSTATUS_UPDATEtyperenderMessageList()shows status emoji + "Status Update" labelrenderMessageDetail()adds a STATUS_UPDATE detail viewtemplate/shop/service.jsprocessDecryptedMessage()extended to handleSTATUS_UPDATEtypeTest plan
🤖 Generated with Claude Code