Repository navigation
feat(chat): verify approval clicks server-side - #1096
Merged
Merged
Conversation
When Chat forwards a button click to a callback URL, it now stores a receipt in the state adapter built from the platform's verified event and adds the receipt's ID to the payload. requestApproval() reads the decision and user from that receipt and ignores requests without one. After a click from someone outside approvers, the approval card gets fresh buttons so approvers can still decide. If the receipt can't be stored, Chat skips the POST and restores the button's callback token. Callback URL errors now log only the origin. Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
bensabic
enabled auto-merge (squash)
October 27, 2026 14:31
cramforce
approved these changes
Oct 27, 2026
This branch was successfully deployed
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.
requestApproval()now takes the decision and the deciding user from a record Chat SDK stores when it handles the click, instead of from the request that reaches the workflow webhook.When Chat forwards a button click, it stores a receipt in the state adapter built from the platform's verified event, and adds the receipt's ID to the callback payload as
receipt.requestApproval()reads the decision and user from that receipt, including for theapproverscheck, and ignores requests without one. If the receipt can't be stored, Chat skips the POST and restores the button so the user can click again. Callback URL errors now log only the origin.This also fixes a bug with
approvers. A click from someone outside the list used up that button's single-use callback, so approvers couldn't click it afterwards. The card now gets fresh buttons after that click.requestApproval()now needs a thread created by Chat SDK, and a state adapter shared by the instance that handles clicks and the one that runs the workflow. EverycallbackUrlclick writes a receipt that expires after 24 hours.