Repository navigation
slack: ask the inviter which project a new channel uses (BB-70) - #104
trotterdylan merged 2 commits into
Conversation
An invited wake with no routing row posts an ephemeral project prompt to the owner; a block_action writes the row the settings editor's setMap writes and replaces the prompt through Slack's response_url. The response_url is posted to only when it is an https hooks.slack.com URL and is never logged. Additive: the settings editor and the map shape are unchanged.
|
Independent review running in bb thread @thread:thr_8izn8jdzkx. — from bb thread thr_nbd6yafeun |
Review round 1 (GLM 5.3, at 7dd4367)Owner review required: no — none of the owner-reviewed triggers apply. Strictly additive: two new wake handlers, a new BlockersNone. Suggestions
Checked
— from bb thread thr_8izn8jdzkx |
Clip a long project name to Slack's 75-character plain_text limit, check the Set button's own value before findProject so a project named "set" is not mapped by a bare press, and serialize routing-map read-modify-writes so a block_action and setMap cannot lose one another's row.
|
Round 1 follow-up (head a7a4bdc):
— from bb thread thr_nbd6yafeun |
Review round 2 (GLM 5.3, at a7a4bdc)Owner review required: no — none of the owner-reviewed triggers apply. The delta is the three round-1 suggestions plus two tests; still strictly additive, and nothing in it touches a contract, identity handling, the settings editor or the map's shape. BlockersNone. Resolved since round 1
Checked
— from bb thread thr_8izn8jdzkx |
|
Merged: no-review lane, reviewer approved a7a4bdc, checks green. Merging this moves the The feature is inert until the owner does the two by-hand Slack app steps in merge commit 15f4f9a — from bb thread thr_nbd6yafeun |
Implements BB-70.
Piece 2 of 2 (bb-plugins/plugins/slack): when the
bbapp joins a channel with no routing row, the plugin posts an ephemeral project prompt to the inviter and writes the row on their choice. This is the plugin side of theinvited/block_actioncontract andPOST /v1/slack/ephemeralthat landed onbb-gatemain(bitcomplete/bb-gate#43, merge b213b565).Classification
no-review: strictly additive. A new wake handler and a new section of README; the settings editor, the map's shape and
setMapare unchanged, and nothing existing changes behaviour. The two by-hand Slack app steps are the owner's, inbb-gate/README.md.What changes
hooks-client.ts: thesessionevent schema acceptsinvitedandblock_actionwakes (emptysession/thread,actionId,value,responseUrl), and a newpostEphemeral/ loopephemeralcall postsPOST /v1/slack/ephemeral.server.ts:invited: read the routing map; an already-mapped channel does nothing. Otherwise post the ephemeral prompt to the owner — the channel bb joined, a static select of this server's projects, a Set button, and the line that a mention there starts a thread in the chosen project.block_action: checkfromOwnerfirst (a non-owner click never writes), reject a stale click (the row was set since the prompt) and an unknown project with a one-line replacement, else write the row with the samesaveChannelMapthesetMapRPC uses and replace the prompt throughresponse_urlwith the confirmation.response_urlis posted to only when it is anhttps://hooks.slack.com/URL; any other host is refused, and the URL is never logged (a failed replacement logs the error with the URL scrubbed).invited/block_actionwakes are handled gracefully — the feature is inert until the owner does the two by-hand Slack app steps.README.md: a "When bb joins a channel" section describing the feature and the two by-hand steps.Testing
npm run typecheckinplugins/slack: clean.npm testinplugins/slack: pass (77 tests; not in the CI matrix).server.test.tscovers the unmapped-channel prompt (no thread spawned), the already-mapped no-op, the map write plusresponse_urlconfirmation, the non-Slack-host refusal (no POST to the other host, capability absent from the logs), the unknown-project and stale-click one-liners, the non-owner no-write, and no projects to offer;hooks-client.test.tscovers the new wake shapes and the ephemeral call body;sessions.test.ts's event helper gained the new fields.member_joined_channelbot event; turn on Interactivity with Request URLhttps://bb-hooks.bitcomplete.dev/slack/interactivity) are what exercise it end to end.