Repository navigation
slack: one routing rule and the settings page owns the token and map (BB-65) - #91
Conversation
|
Independent review running in bb thread @thread:thr_3kdhdqg4p6. — from bb thread thr_ggv78tpd2w |
Review round 1 (GLM 5.3, at 0e42798)Owner review required: yes — it changes existing routing behaviour (the Suggestions
Checked
— from bb thread thr_3kdhdqg4p6 |
|
Round 1 suggestions addressed in
— from bb thread thr_ggv78tpd2w |
Review round 2 (GLM 5.3, at 44d677e)Owner review required: yes — unchanged from round 1: the change removes existing routing behaviour (the Resolved since round 1
Checked
— from bb thread thr_3kdhdqg4p6 |
|
Approved 44d677e from the Stewards page |
|
Merged: owner-reviewed lane, reviewer GLM 5.3 approved Merging moves the — from bb thread thr_ggv78tpd2w |
Implements BB-65. The Slack plugin's settings page no longer duplicates bb core's Configuration box, and routing is one rule: a mention in a mapped channel starts its thread in that channel's project; everything else, DMs included, starts in the fallback. The sign-in token and the map move out of
settingDescriptorsintobb.storage.kv; thedmkey, the DM-own-id lookup and the assistant-pane context-channel lookup are gone.Classification
owner-reviewed: it changes existing routing behaviour (the
dmentry and the context-channel lookup go away) and moves a secret out of settings, plus a data migration.What changes
settingDescriptorsdeclares nothing. The token lives at kvsignin/tokenand the map atrouting/map; the plugin's own Slack section is the only place they are managed. Thesettings.onChangelistener is gone — the cached token is updated by the explicit writes (sign-in, sign-out, refused-token). The token is never in the status RPC or the page.{ fallback, channels: [{ channel, project }] }.chooseConversationProjectuses the channel entry for a mention and the fallback otherwise. Thedmkey,DM_CHANNEL, the DM-own-id lookup and thecontextChannellookup are removed.setMapRPC rejects an empty fallback). A fallback naming a project this server lacks shows a warning beside the row and is skipped at run time, so one map works on every server.settings/migratedkv marker. The old token setting is copied to kv and cleared; the map is built withfallback= the olddmentry, else the oldprojectsetting, else unset (the editor asks). The olddmentry is dropped from the channel rows.slackskill and the settings-section copy describe the single rule.dmwins when both existed and differedWhen both the old
dmentry and the oldprojectsetting named a project and they differed, the olddmentry wins the new fallback — DMs are the main traffic. A unit test pins this.bb core and an empty Configuration box
Checked against bb core (
desktop-v0.46.0, the deployed pin, and 0.46.1; identical behaviour) (apps/app/src/components/plugin/PluginSettings.tsx,apps/server/src/services/plugins/plugin-service.ts). With no declared settings,hasSettingsis false;PluginSettingsDetailthen omits the recessed declarative panel entirely and renders only the plugin'ssettingsSection. The Configuration section header still renders because the plugin registers a settings section, but it is not an empty box and no dummy setting is needed. The one-time migration does declare the old descriptors on the load that performs it — the supported settings API can only read and clear a setting through a declared descriptor — so the old token field exists (empty, its value cleared) on that single load; a later load declares none. The token value is never shown.Rollback
The migration clears only the old token setting; the old
projectandchannelssettings are left in place. Rolling back to the previous image therefore means signing in to Slack again (the old token setting is gone), and the oldprojectandchannelssettings would then apply.Testing
npm testinplugins/slack: pass (68 tests; not in the CI matrix —.github/workflows/plugins.yamllists neitherslacknor this repo's other live plugins).npm run typecheckinplugins/slack: pass.— from bb thread thr_ggv78tpd2w