Skip to content

feat(engine): Baileys group management + profile + block/unblock (slice 3a)#309

Merged
rmyndharis merged 6 commits into
mainfrom
feat/baileys-groups
Jun 18, 2026
Merged

feat(engine): Baileys group management + profile + block/unblock (slice 3a)#309
rmyndharis merged 6 commits into
mainfrom
feat/baileys-groups

Conversation

@rmyndharis

Copy link
Copy Markdown
Owner

Summary

Slice 3a of the Baileys engine: un-gates the storeless live ops — all group management, profile-picture fetch, and block/unblock — via direct Baileys socket calls. No store, no DB, no DI changes.

Stacked on #308 (base branch feat/baileys-store-ops, itself stacked on #307#299). This PR's diff is slice-3a only; the base retargets to main as the stack merges down.

What's added (15 methods, all ensureReady()-guarded)

  • Group management: getGroups (groupFetchAllParticipating, one call — no N+1), getGroupInfo (groupMetadata), createGroup, participant ops (groupParticipantsUpdate with add/remove/promote/demote), leaveGroup, setGroupSubject/setGroupDescription, getGroupInviteCode/revokeGroupInviteCode.
  • getProfilePicture (profilePictureUrl → url, or null when none/hidden).
  • blockContact/unblockContact (updateBlockStatus).
  • New pure baileys-group-mapper (GroupMetadata → neutral Group/GroupInfo/GroupParticipant) — the sole Baileys-group→neutral boundary (type-only baileys import, no runtime load, unit-tested without a socket). Group.isAdmin is computed by matching the session's own JID against admin/superadmin participants.
  • getFeatures() now advertises group-management.

Behavior notes

  • getGroupInfo / getProfilePicture degrade to null on rejection (no such group / no picture / hidden), with a debug log for operator traceability — matching the neutral | null contract.
  • isAnnounce/isReadOnly are mapped best-effort from Baileys' announce flag (WhatsApp's announce/restrict semantics are fuzzy).

Out of scope (still 501)

getContacts/getContactById/getChats/sendSeen/getChatHistory/deleteChat/resolveContactPhone → the contact/chat-store slice (3b). Labels/channels/status/catalog/getMessageReactions stay unsupported (parity with the whatsapp-web.js engine, which also stubs them).

Testing

  • 613 unit + 6 e2e green; backend lint 0 / build clean; dashboard build clean / lint 0 errors.
  • New coverage: group mapper (mapped shapes, self-admin true/false/superadmin/plain-admin, linked parent); adapter (each op → exact sock.* call + args, getGroups/getGroupInfo mapped, getGroupInfo null-on-reject, invite codes, profile url + null, block/unblock action literals, ensureReady pre-connect); the e2e boot-gate feature list synced to the 10-entry set.

Base automatically changed from feat/baileys-store-ops to main June 18, 2026 08:37
@rmyndharis rmyndharis merged commit 04ddaa0 into main Jun 18, 2026
@rmyndharis rmyndharis deleted the feat/baileys-groups branch June 18, 2026 08:37
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.

1 participant