refactor(slack): centralize modal private_metadata utilities#18409
Closed
Solvely-Colin wants to merge 1 commit into
Closed
refactor(slack): centralize modal private_metadata utilities#18409Solvely-Colin wants to merge 1 commit into
Solvely-Colin wants to merge 1 commit into
Conversation
This was referenced Feb 16, 2026
Solvely-Colin
force-pushed
the
codex/slack-modal-metadata-utils
branch
from
February 16, 2026 23:03
f7aafce to
eaf2ee6
Compare
Solvely-Colin
force-pushed
the
codex/slack-modal-metadata-utils
branch
from
February 17, 2026 00:55
eaf2ee6 to
86996a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Modal
private_metadataparsing is currently embedded in interaction handler logic. A shared utility makes routing metadata consistent and gives us an explicit producer-facing encoder for future modal-open flows.Dependency
f7aafce81.What This PR Adds
New utility module:
/Users/solvely/Projects/OpenClaw/src/slack/modal-metadata.tsparseSlackModalPrivateMetadata(raw)encodeSlackModalPrivateMetadata(input)Utility behavior:
sessionKey,channelId,channelType)private_metadata <= 3000 chars)Interaction handler wiring:
/Users/solvely/Projects/OpenClaw/src/slack/monitor/events/interactions.tsnow uses shared parse utility.Tests:
/Users/solvely/Projects/OpenClaw/src/slack/modal-metadata.test.tsBehavior
Validation
pnpm test src/slack/modal-metadata.test.ts src/slack/monitor/events/interactions.test.tspnpm checkReviewer Focus
src/slack/modal-metadata.tssrc/slack/modal-metadata.test.tssrc/slack/monitor/events/interactions.tsGreptile Summary
This PR preserves the method binding for
viewClosedin the Slack interaction handler. The change extracts the typedappobject reference instead of just the method, ensuring the correctthiscontext is maintained when callingviewClosed. This prevents potential runtime errors from losing the method's binding to its parent object.Confidence Score: 5/5
viewClosedfunctionality), follows established patterns, and has no side effects on other code paths.Last reviewed commit: 86996a3