From ce4a6c9bbabc9092a2cbfb99640d46d2d6db6c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E6=99=BA=E8=B6=850668000959?= Date: Sat, 27 Jun 2026 09:19:13 +0800 Subject: [PATCH 1/2] fix(line): explicitly ignore resp.Body.Close() errors in Send and classifySDKError --- pkg/channels/line/line.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/channels/line/line.go b/pkg/channels/line/line.go index d4d34211..13c2c6e0 100644 --- a/pkg/channels/line/line.go +++ b/pkg/channels/line/line.go @@ -481,11 +481,11 @@ func (c *LINEChannel) Send(ctx context.Context, msg bus.OutboundMessage) ([]stri ReplyToken: tokenEntry.token, Messages: []messaging_api.MessageInterface{&textMsg}, }) - if resp != nil && resp.Body != nil { - resp.Body.Close() - } - if err == nil { - logger.DebugCF("line", "Message sent via Reply API", map[string]any{ + if resp != nil && resp.Body != nil { + _ = resp.Body.Close() + } + if err == nil { + logger.DebugCF("line", "Message sent via Reply API", map[string]any{ "chat_id": msg.ChatID, "quoted": quoteToken != "", }) @@ -588,7 +588,7 @@ func (c *LINEChannel) StartTyping(ctx context.Context, chatID string) (func(), e // classifySDKError maps an SDK HTTP response to the project's sentinel errors. func classifySDKError(resp *http.Response, err error) error { if resp != nil && resp.Body != nil { - resp.Body.Close() + _ = resp.Body.Close() } if err == nil { return nil From 9068fde2742ab2ad29cce79c684a94b688bc6a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E6=99=BA=E8=B6=850668000959?= Date: Sat, 27 Jun 2026 10:20:37 +0800 Subject: [PATCH 2/2] fix: gofumpt formatting on line.go --- pkg/channels/line/line.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/channels/line/line.go b/pkg/channels/line/line.go index 13c2c6e0..6349c4ed 100644 --- a/pkg/channels/line/line.go +++ b/pkg/channels/line/line.go @@ -69,7 +69,8 @@ func NewLINEChannel( return nil, fmt.Errorf("failed to create LINE messaging client: %w", err) } - base := channels.NewBaseChannel("line", cfg, messageBus, bc.AllowFrom, + base := channels.NewBaseChannel( + "line", cfg, messageBus, bc.AllowFrom, channels.WithMaxMessageLength(5000), channels.WithGroupTrigger(bc.GroupTrigger), channels.WithReasoningChannelID(bc.ReasoningChannelID), @@ -481,11 +482,11 @@ func (c *LINEChannel) Send(ctx context.Context, msg bus.OutboundMessage) ([]stri ReplyToken: tokenEntry.token, Messages: []messaging_api.MessageInterface{&textMsg}, }) - if resp != nil && resp.Body != nil { - _ = resp.Body.Close() - } - if err == nil { - logger.DebugCF("line", "Message sent via Reply API", map[string]any{ + if resp != nil && resp.Body != nil { + _ = resp.Body.Close() + } + if err == nil { + logger.DebugCF("line", "Message sent via Reply API", map[string]any{ "chat_id": msg.ChatID, "quoted": quoteToken != "", })