Skip to content

fix(zalouser): route reactions through canonical conversation targets - #118536

Merged
steipete merged 1 commit into
mainfrom
codex/qa0803-zalouser-reactions
Aug 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa0803-zalouser-reactions

Conversation

@steipete

@steipete steipete commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Zalouser reactions sent to prefixed group conversations or an ambient group could be dispatched as direct messages, selecting the wrong upstream Zalo API endpoint and identifier field. Prefixed target identifiers were also forwarded without canonical normalization.

Root Cause and Canonical Repair

The reaction adapter bypassed the existing Zalouser outbound target parser and defaulted group classification to false. Core action normalization can materialize the ambient conversation into params.to before the plugin sees it, so checking only whether a target was explicitly present is insufficient. The owner now reuses parseZalouserOutboundTarget, preserves explicit isGroup overrides, trusts ambient group metadata only when both the provider and exact raw conversation target match, and returns the normalized conversation identity.

Verified Upstream Dependency Contract

Actual installed zca-js 2.1.2 source and types were inspected directly. User reactions use /api/message/reaction and a toid field; group reactions use /api/group/reaction and a grid field. Incorrect classification is therefore a concrete wrong-endpoint provider failure.

Exact-Head Real Authenticated Gateway Proof

The exact published head 7492c85 passed an actual ephemeral loopback Gateway using signed backend runtime-identity tokens, real WebSocket authentication, the actual registered Zalouser plugin, and genuine message.action RPC calls. Only the external Zalo transport was mocked, so no credentials, real account, or user conversation were touched.

  • Two distinct authenticated group-reaction target forms reached the actual plugin with the canonical group identifier and isGroup true.
  • One prefixed direct-message alias reached the actual plugin with isGroup false.
  • Foreign Slack conversation context was rejected before any Zalouser provider call.
  • External transport invoked exactly three times, exclusively for the three authorized conversation routes.
  • Complete authenticated Gateway scenario: 1/1 passing.

Regression Evidence

  • Initial RED: a core-materialized ambient group target incorrectly selected isGroup false.
  • Independent security RED: a foreign provider with the same conversation identifier incorrectly donated isGroup true.
  • Final focused suite: 23/23 tests passing.
  • Coverage includes prefixed group/direct destinations, raw ambient groups, core-materialized groups, explicit same-identifier direct targets, explicit boolean overrides, target precedence, selected account, and cross-provider identity collisions.
  • Independent owner/dependency/sibling/security review clean.
  • Exact-head required openclaw/ci-gate and real-behavior-proof checks both succeeded.
  • Production delta +10 lines; tests +106 lines.
  • AI-assisted implementation and independently verified source review.

@openclaw-barnacle openclaw-barnacle Bot added channel: zalouser Channel integration: zalouser size: S maintainer Maintainer-authored PR labels Aug 3, 2026
@steipete
steipete merged commit 4281e90 into main Aug 3, 2026
97 of 101 checks passed
@steipete
steipete deleted the codex/qa0803-zalouser-reactions branch August 3, 2026 06:52
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: zalouser Channel integration: zalouser maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant