feat(pancake): add Shopee platform support#975
Conversation
- Fix Accept header for JSON response negotiation (Shopee GETs) - Platform-prefix-aware pageID parsing (spo_ convID format) - 500-char message limit for Shopee DMs - Rune-safe truncation with slog.Warn on truncation Phase 3 (integration smoke) pending: requires real credentials.
🔍 Code Review — feat(pancake): add Shopee platform support🎯 Tổng quanThêm Shopee platform support vào pancake channel: fix Accept header cho JSON response negotiation, platform-prefix-aware pageID parsing, 500-char message limit, và rune-safe truncation. Scope: 8 files, +180/-18 lines ✅ Điểm Tốt
|
| Severity | Count | Issues |
|---|---|---|
| 🟡 MEDIUM | 1 | `platformPrefixes] hardcoded, nên config-driven |
| 🟢 LOW | 2 | Function name generic; testdata fixture thiếu page_id case |
💡 Recommendation
🟡 APPROVE WITH CHANGES
PR clean, Shopee support implement đúng hướng. Issue #1 (platformPrefixes config) nên fix trước khi merge để avoid technical debt. #2 và #3 là optional.
Great work @nguyennguyenit! 🚀
Add MethodSessionsCompact to isWriteMethod to fix drift coverage test. Method was added in #958 but missing from permissions classification.
Remove duplicate contains helper in tts_gemini_live_test.go that conflicts with mcp_grant_revoke_test.go in same package.
🔍 Re-Review — PR #975 (after feedback fixes)Status: ✅ All previous issues addressed
Additional observations
Recommendation🟢 APPROVE All feedback addressed. PR sạch, Shopee support ready to merge. Phase 3 integration smoke pending real credentials — có thể merge trước, Phase 3 follow-up sau. Great work @nguyennguyenit! 🚀 |
Summary
Accept: application/jsonheader for Pancake GET requests (Shopee returns SPA HTML without it)spo_convID formatslog.Warnon truncationChanges
api_client.gosetCommonHeadershelper, wired toGetPage+newPageRequestwebhook_handler.goresolvePageIDFromConvID+platformPrefixesmap (spo only)pancake.goshopeeto 500-char limit caseformatter.gotruncateForTikTok→truncateRuneSafe(content, limit)Test plan
TestNewPageRequest_SetsAcceptJSONHeader— Accept header on page-API requestsTestGetPage_SetsAcceptJSONHeader— Accept header on user-API requests (C2)TestResolvePageIDFromConvID— 6 cases: FB numeric, Shopee 3-seg, Shopee 2-seg, empty, no underscore, prefix-onlyTestMaxMessageLength_Shopee— returns 500TestTruncateRuneSafe_Shopee— Vietnamese + emoji truncation