fix(approvals): persist delivery target on pending_approvals rows#2820
Open
caburi00 wants to merge 1 commit into
Open
fix(approvals): persist delivery target on pending_approvals rows#2820caburi00 wants to merge 1 commit into
caburi00 wants to merge 1 commit into
Conversation
requestApproval() created the pending_approvals row before picking an approver and never recorded where the card was ultimately delivered, so channel_type / platform_id / platform_message_id stayed NULL on every row. That makes `approvals list` unable to show the real destination and leaves no record of which chat a card went to. Capture the adapter.deliver() result and write the target back via a new updatePendingApprovalDelivery() helper once the card is sent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 20, 2026
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.
Problem
requestApproval()creates thepending_approvalsrow before it picks an approver, and never records where the card was ultimately delivered. Sochannel_type,platform_id, andplatform_message_idstayNULLon every approval row.Consequences:
approvals list(andapproval get) can't show the real destination — the columns documented as "Channel the approval card was delivered on" are always empty.Fix
Capture the
adapter.deliver()return (the platform message id) and write the delivery target back to the row via a small newupdatePendingApprovalDelivery()helper, right after the card is sent. No behavior change on the delivery path itself; purely fills in the previously-NULL columns.Test
src/db/pending-approval-delivery.test.ts— asserts the columns start NULL on create and are populated after delivery, including the null-platform_message_idcase.🤖 Generated with Claude Code