hermes - 💡(How to fix) Fix SimpleX adapter: group sender read from chatItemMember instead of chatDir.groupMember

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

For inbound group messages, the SimpleX adapter extracts the sending member from the wrong key, so it can't identify who sent a group message. The bot treats the sender as the chat itself, which breaks allowlist matching.

Root Cause

For inbound group messages, the SimpleX adapter extracts the sending member from the wrong key, so it can't identify who sent a group message. The bot treats the sender as the chat itself, which breaks allowlist matching.

Fix Action

Fix / Workaround

Downstream allowlist matching compares against the real member id, but sender_id is the chat id — so authorized group members are not recognized, and group messages can be rejected even when delivery and dispatch otherwise work.

Code Example

member = chat_item.get("chatItemMember") or {}

---

chat_item_keys = ['chatDir', 'content', 'mentions', 'meta', 'reactions']
# no 'chatItemMember'; sender lives at chatItem.chatDir.groupMember

---

chat_dir = chat_item.get("chatDir") or {}
member = chat_dir.get("groupMember") or chat_item.get("chatItemMember") or {}
if is_group and member:
    member_profile = member.get("memberProfile") or {}
    sender_id = str(
        member.get("memberId")
        or member.get("groupMemberId")
        or member.get("id")
        or chat_id
    )
    sender_name = (
        member.get("displayName")
        or member.get("localDisplayName")
        or member_profile.get("displayName")
        or sender_id
    )
RAW_BUFFERClick to expand / collapse

Summary

For inbound group messages, the SimpleX adapter extracts the sending member from the wrong key, so it can't identify who sent a group message. The bot treats the sender as the chat itself, which breaks allowlist matching.

Environment

  • simplex-chat: latest stable
  • Hermes: SimpleX platform plugin (plugins/platforms/simplex/adapter.py)
  • Verified on Ubuntu 24.04

Details

_handle_new_chat_item reads the group member from chatItem.chatItemMember:

member = chat_item.get("chatItemMember") or {}

Current simplex-chat reports the member under chatItem.chatDir.groupMember instead — there is no chatItemMember key in the payload. So member is empty, and sender_id falls back to the chat_id (e.g. "group:1"), which is never a real member id.

Observed payload shape for a group message:

chat_item_keys = ['chatDir', 'content', 'mentions', 'meta', 'reactions']
# no 'chatItemMember'; sender lives at chatItem.chatDir.groupMember

Impact

Downstream allowlist matching compares against the real member id, but sender_id is the chat id — so authorized group members are not recognized, and group messages can be rejected even when delivery and dispatch otherwise work.

Suggested fix

Read chatDir.groupMember first, fall back to chatItemMember for older payloads, and resolve the display name via memberProfile:

chat_dir = chat_item.get("chatDir") or {}
member = chat_dir.get("groupMember") or chat_item.get("chatItemMember") or {}
if is_group and member:
    member_profile = member.get("memberProfile") or {}
    sender_id = str(
        member.get("memberId")
        or member.get("groupMemberId")
        or member.get("id")
        or chat_id
    )
    sender_name = (
        member.get("displayName")
        or member.get("localDisplayName")
        or member_profile.get("displayName")
        or sender_id
    )

Relationship to existing work

This is distinct from the three bugs in #30150 / PR #26433 (missing /_start, newChatItems resp-nesting, /_send syntax) — those don't touch sender extraction. The same chatDir.groupMember change also appears inside the larger feature PRs #4666 and #27978. Filing this as a focused, separately trackable bug; PR to follow.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix SimpleX adapter: group sender read from chatItemMember instead of chatDir.groupMember