Skip to content

fix: supported reactions not advertised correctly#213

Merged
highesttt merged 1 commit into
mainfrom
highest/plat-37893
Jul 10, 2026
Merged

fix: supported reactions not advertised correctly#213
highesttt merged 1 commit into
mainfrom
highest/plat-37893

Conversation

@highesttt

Copy link
Copy Markdown
Collaborator

No description provided.

@linear-code

linear-code Bot commented Jul 10, 2026

Copy link
Copy Markdown

PLAT-37893

@indent-zero

indent-zero Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
PR Summary

Advertises the concrete list of LINE-supported reactions to Matrix clients via com.beeper.room_features so the reaction picker reflects what the LINE send-path will actually accept. Previously the bridge declared Reaction: PartialSupport but never populated AllowedReactions/ReactionCount, so client-side filtering was impossible.

  • pkg/connector/userinfo.go: LineClient.GetCapabilities now sets ReactionCount: 1 and returns AllowedReactions derived from the canonical lineEmojiReactionURLs map.
  • pkg/connector/reaction.go: New package-init lineAllowedReactions slice builds every advertised key from the map — bare digits 0..9 are wrapped to <digit>\u20E3 and everything is run through variationselector.Add (so keycaps become <digit>\uFE0F\u20E3 and hearts become \u2764\uFE0F), then sorted so the com.beeper.room_features hash is stable across restarts. getLineAllowedReactions() returns a defensive slices.Clone.
  • pkg/connector/connector.go: GetBridgeInfoVersion bumps capabilities from 1 to 2 so bridgev2 republishes the enriched feature payload to clients.
  • pkg/connector/reaction_test.go: New TestCapabilitiesAdvertiseSupportedReactions pins version bump, Reaction/ReactionCount, length matches the map, sortedness, uniqueness, mapper round-trip for every entry, positive checks for \U0001F44D\uFE0F and 9\uFE0F\u20E3, negative check for \U0001F625, and that mutating the returned slice does not poison later calls.

Issues

No issues found.

CI Checks

All CI checks passed on 046eddb.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8e700bb2-87ce-4756-8be8-d16c0418a28e

📥 Commits

Reviewing files that changed from the base of the PR and between 3ff4e26 and 046eddb.

📒 Files selected for processing (4)
  • pkg/connector/connector.go
  • pkg/connector/reaction.go
  • pkg/connector/reaction_test.go
  • pkg/connector/userinfo.go

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added support for advertising Line reaction capabilities.
    • Rooms now report supported reactions, including the maximum reaction count and allowed reaction list.
    • Reaction capability version updated to version 2.
    • Allowed reactions are sorted, validated, and protected from unintended modification.

Walkthrough

LINE connector capability versioning is updated to version 2, and reaction capabilities now advertise a normalized, sorted list of supported reactions with defensive slice cloning. Tests validate versions, contents, ordering, support checks, and isolation.

Changes

LINE reaction capabilities

Layer / File(s) Summary
Capability version and reaction list
pkg/connector/connector.go, pkg/connector/reaction.go
Updates the capability version and builds a normalized, sorted cached list of supported reactions.
Capability advertisement and validation
pkg/connector/userinfo.go, pkg/connector/reaction_test.go
Publishes reaction support through GetCapabilities and validates versions, contents, ordering, and slice isolation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TestCapabilitiesAdvertiseSupportedReactions
  participant LineClient
  participant getLineAllowedReactions
  TestCapabilitiesAdvertiseSupportedReactions->>LineClient: call GetCapabilities with context
  LineClient->>getLineAllowedReactions: obtain allowed reactions
  getLineAllowedReactions-->>LineClient: return cloned sorted slice
  LineClient-->>TestCapabilitiesAdvertiseSupportedReactions: return reaction capabilities
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch highest/plat-37893

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Comment @coderabbitai help to get the list of available commands.

@highesttt highesttt merged commit 0f8ea15 into main Jul 10, 2026
9 checks passed
@highesttt highesttt deleted the highest/plat-37893 branch July 10, 2026 12:54
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