Skip to content

fix: bridge legacy LINE multi-person rooms via getRoomsV2 - #264

Merged
highesttt merged 1 commit into
mainfrom
highest/plat-39239
Oct 12, 2026
Merged

highesttt merged 1 commit into
mainfrom
highest/plat-39239

Conversation

@highesttt

Copy link
Copy Markdown
Collaborator

No description provided.

@linear-code

linear-code Bot commented Oct 12, 2026

Copy link
Copy Markdown

PLAT-39239

@indent

indent Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Issues

1 potential issue found:

  • GetChatInfo now sends every "r" portal to getRoomsV2 and builds a Chat with only mid, type and members. For ROOM chats that getChats does return, a resync drops the name, avatar, invitees and creator power level that startup sync sets. Try getChats first and fall back to getRoomsV2 only when it returns nothing.
    Found by Indent Review Agent

↑ Select any checkbox above to have Indent auto-fix the issue

CI Checks

All CI checks passed on 29af238.

Review agents

Select any unchecked box below to run or rerun that agent.

Found issues (1)
  • Indent Review Agent · getRoomsV2 path replaces getChats for all "r" mids, dropping name/avatar/invitees on resync.
Full results

Indent Review Agent

  • Summary: getRoomsV2 path replaces getChats for all "r" mids, dropping name/avatar/invitees on resync.
  • Last ran on commit: 29af2380
  • Latest result
    {
      "summary": "getRoomsV2 path replaces getChats for all \"r\" mids, dropping name/avatar/invitees on resync.",
      "findings": [
        {
          "fix": "Keep getChats as the first lookup for \"r\" mids and use getRoomsV2 only when getChats returns no chats (or errors). Alternatively, decode more of the Room response (e.g. contacts) and leave ChatInfo fields like Name and Avatar nil instead of empty values, so a resync doesn't overwrite them.",
          "line": 155,
          "path": "pkg/connector/userinfo.go",
          "issue": "GetChatInfo now sends every portal ID starting with \"r\" to getRoomsV2 and builds a Chat that only has ChatMid, Type 1 and MemberMids. The rest of the connector still gets type-1 ROOM chats from getChats: syncChatsNow batches every isChatMID (c or r) through GetChats, and chatToChatInfo has type-1 branches for invitees and generated names. For any \"r\" chat that getChats returns, a GetChatInfo resync now produces a different ChatInfo than startup sync: ChatName is empty so a custom name is replaced by a generated one; PicturePath is empty so avatarFromPicturePath returns Avatar{Remove:true} and clears the avatar; InviteeMids is nil, so with Members.IsFull=true, invitees who are shown as joined for type-1 chats get removed; CreatorMid is empty so the creator's power level drops from 100 to 0. Startup sync and GetChatInfo then keep overwriting each other.",
          "title": "All \"r\" portals now skip getChats, losing name/avatar/invitees/creator for ROOM chats that getChats does return",
          "severity": "bug"
        }
      ]
    }

Comment thread pkg/connector/userinfo.go
if len(res.Chats) == 0 {
return nil, fmt.Errorf("chat not found")
var chat *line.Chat
if strings.HasPrefix(lowerMid, "r") {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Bug · All "r" portals skip getChats, losing name/avatar/invitees/creator on resync

Every portal ID starting with "r" now goes to getRoomsV2, and the synthesized Chat has only ChatMid, Type 1 and MemberMids. syncChatsNow still gets type-1 ROOM chats from getChats, so for any "r" chat getChats returns, a GetChatInfo resync produces a different ChatInfo than startup sync: empty ChatName replaces a custom name, empty PicturePath clears the avatar, nil InviteeMids removes invitees (Members.IsFull=true), and empty CreatorMid drops the creator's power level from 100 to 0. The two paths then overwrite each other.

Keep getChats as the first lookup for "r" mids and use getRoomsV2 only when getChats returns no chats (or errors).

Found by Indent Review Agent

@highesttt
highesttt merged commit 222ef62 into main Oct 12, 2026
9 checks passed
@highesttt
highesttt deleted the highest/plat-39239 branch October 12, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant