Skip to content

fix(cli): support user (1:1) chats in messages commands - #258

Merged
nakasyou merged 1 commit into
mainfrom
fix/cli-user-chat-messages
Nov 4, 2026
Merged

nakasyou merged 1 commit into
mainfrom
fix/cli-user-chat-messages

Conversation

@nakasyou

@nakasyou nakasyou commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Description

line chats messages <mid> and line messages show <mid> <messageId> crashed for 1:1 (user) mids with Cannot read properties of undefined (reading 'chatMid').

Cause: resolveTalkMessage and chats messages called client.getChat(mid), which wraps talk.getChat — a group/room-only API. For user mids it yields no chat, so constructing Chat from undefined blew up.

This PR routes u... mids through the message-box APIs instead (getMessageBoxes to find the box, getPreviousMessagesV2WithRequest for history, TalkMessage.fromRawTalk for E2EE decryption), shared via new fetchTalkMessages/fetchUserTalkMessages helpers in packages/cli/src/commands/shared.ts. Group/room behavior is unchanged.

Checklist

  • Run tests
  • Test in your environment (typecheck, build, and a single live messages show call against a 1:1 chat decrypted the text successfully; content omitted)

talk.getChat only serves group/room chats, so user mids failed with Chat({raw: undefined}). Route u... mids through the message-box APIs (getMessageBoxes + getPreviousMessagesV2WithRequest + TalkMessage.fromRawTalk) shared by chats messages and messages show/pin/data. Group/room behavior is unchanged.
Copilot AI balanced review requested due to automatic review settings November 4, 2026 14:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@nakasyou
nakasyou merged commit 0276af2 into main Nov 4, 2026
2 checks passed
@nakasyou
nakasyou deleted the fix/cli-user-chat-messages branch November 4, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants