Skip to content

Slack: enrich block action context payloads#18431

Closed
Solvely-Colin wants to merge 1 commit into
openclaw:mainfrom
Solvely-Colin:codex/slack-block-action-context
Closed

Slack: enrich block action context payloads#18431
Solvely-Colin wants to merge 1 commit into
openclaw:mainfrom
Solvely-Colin:codex/slack-block-action-context

Conversation

@Solvely-Colin

@Solvely-Colin Solvely-Colin commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Enriches Slack block_action interaction events with additional context fields and safer channel/message fallbacks.

  • include teamId, triggerId, responseUrl, and threadTs in block action payloads
  • fall back to container.channel_id/container.message_ts when channel/message are absent
  • add regression coverage for container-based fallback payload resolution

Scope

  • src/slack/monitor/events/interactions.ts
  • src/slack/monitor/events/interactions.test.ts

Validation

  • pnpm test src/slack/monitor/events/interactions.test.ts
  • pnpm check

Dependency

Depends on:

If reviewing before dependencies merge, review tip commit: a0d55470b.

Greptile Summary

Refactors the viewClosed method call in registerSlackInteractionEvents to preserve this binding. The previous code extracted viewClosed from the type-cast ctx.app object into a standalone variable, then called it directly — which would lose the method's this context if the underlying implementation depends on it. The new code keeps a reference to the whole cast object (appWithViewClosed) and invokes appWithViewClosed.viewClosed(...), preserving correct method dispatch.

  • Fix: viewClosed is now called as a method on the object rather than as a detached function, preventing potential this-binding bugs
  • No functional logic changes: the type guard (typeof ... !== "function") and handler registration remain identical
  • Note: The PR title references "enrich block action context payloads" but the diff at this commit range only contains the viewClosed binding fix. The enrichment changes may be in dependent PRs not yet merged into the base.

Confidence Score: 5/5

  • This PR is safe to merge — it's a small, well-scoped refactoring that fixes a potential this-binding issue with no behavioral changes.
  • The change is minimal (8 insertions, 10 deletions), purely mechanical, and correctly preserves the method's this binding. The type guard and handler logic are unchanged. No new code paths, no new dependencies, no risk of regression.
  • No files require special attention.

Last reviewed commit: 22baace

@Solvely-Colin
Solvely-Colin force-pushed the codex/slack-block-action-context branch from eaf2ee6 to 22baace Compare February 17, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants