Skip to content

fix(event): acknowledge card action callbacks - #2456

Open
WRJ7391117 wants to merge 1 commit into
larksuite:mainfrom
WRJ7391117:fix/card-action-trigger-response
Open

fix(event): acknowledge card action callbacks#2456
WRJ7391117 wants to merge 1 commit into
larksuite:mainfrom
WRJ7391117:fix/card-action-trigger-response

Conversation

@WRJ7391117

@WRJ7391117 WRJ7391117 commented Aug 23, 2026

Copy link
Copy Markdown

Summary

Register card.action.trigger with the SDK's typed Card 2.0 callback handler so the WebSocket client returns the required {} acknowledgement instead of treating the callback as a generic custom event. This prevents Feishu callback error 108002 while preserving the existing raw event emission contract.

Changes

  • Route only card.action.trigger through OnP2CardActionTrigger; keep all other event types on OnCustomizedEvent.
  • Return CardActionTriggerResponse{} after the existing raw handler succeeds.
  • Add a regression test covering both raw event emission and the serialized callback response.

Test Plan

  • go test ./internal/event/adapter/lark/websocket
  • make unit-test
  • make vet
  • make fmt-check
  • Live tenant WebSocket callback verification (requires a configured Feishu app and interactive Card 2.0 click)

Related Issues

  • None

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of Feishu card action events.
    • Card action callbacks now return an empty response after the event is processed, ensuring compatibility with expected callback behavior.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions Bot added the size/M Single-domain feat or fix with limited business impact label Aug 23, 2026
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 11aec484-1ae1-4aac-b2cc-a9cb9a84e5c5

📥 Commits

Reviewing files that changed from the base of the PR and between 423e81f and c6d5b12.

📒 Files selected for processing (2)
  • internal/event/adapter/lark/websocket/feishu.go
  • internal/event/adapter/lark/websocket/feishu_ingress_test.go

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Feishu card action dispatch

Layer / File(s) Summary
Typed card action handler registration
internal/event/adapter/lark/websocket/feishu.go
card.action.trigger now uses the typed callback handler, forwards the event to the raw handler, and returns an empty callback response. Other events retain customized handlers.
Card action ingress validation
internal/event/adapter/lark/websocket/feishu_ingress_test.go
The test verifies raw event emission, the callback response type, and {} JSON serialization.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to c6d5b

The change returns the required acknowledgement for card action callbacks while preserving raw event emission, and the listed checks are complete; no actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant FeishuWebsocketIngress
  participant registerHandlers
  participant OnP2CardActionTrigger
  participant RawEventHandler
  FeishuWebsocketIngress->>registerHandlers: Register card.action.trigger
  FeishuWebsocketIngress->>OnP2CardActionTrigger: Dispatch card action event
  OnP2CardActionTrigger->>RawEventHandler: Forward event request
  OnP2CardActionTrigger-->>FeishuWebsocketIngress: Return empty CardActionTriggerResponse
Loading

Suggested reviewers: liangshuo-1

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: acknowledging Feishu card action callbacks.
Description check ✅ Passed The description includes the required summary, changes, test plan, and related issues sections with relevant details.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants