fix(lark): handle card.action.trigger over the long connection#604
Open
loind wants to merge 2 commits into
Open
fix(lark): handle card.action.trigger over the long connection#604loind wants to merge 2 commits into
loind wants to merge 2 commits into
Conversation
Interactive card button clicks arrive over the long connection as an
`event` with event_type `card.action.trigger`, but only frame-type
`card` (webhook mode) was routed to the card handler — so clicks were
dropped ("unhandled event type") and Feishu reported a callback timeout.
Route the event to handle_card_action, and read open_chat_id /
open_message_id from the event `context` (webhook nests them top-level).
Reply to the card callback with a card-callback response body
(`{}` = keep card unchanged) instead of the generic `{"code":200}`
event ack, so the platform no longer reports a callback timeout on the
clicked button. Plain events keep the `{"code":200}` ack.
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
Interactive card button clicks were delivered but did nothing — Feishu reported a callback timeout.
Root cause (confirmed via debug log)
Over the long connection, a card button click arrives as an event with
event_type = "card.action.trigger":handle_ws_textonly routed frame-typecard(webhook mode) tohandle_card_action; theeventbranch handledim.message.receive_v1/application.bot.menu_v6only, socard.action.triggerfell through to_ => unhandledand was dropped → no response → Feishu 3s timeout.Fix
event_type == "card.action.trigger"(event branch) tohandle_card_action.CardActionEventnow readsopen_chat_id/open_message_idfrom the eventcontext(long connection) with fallback to the top-level fields (legacy webhook).Testing
card_action_event_parses_long_connection_context.cargo test -p aionui-channel --features lark— all green.unhandled event type; the fix routes the click to the card handler.Notes
Requires the app's callback subscription (回调订阅) to use the long connection (developer console). Independent of #602 (region) and #603 (pre-auth replay).