Conversation
…struction Live: "Could not add to 3 channel(s): #help: user_is_ultra_restricted; ..." -- a bare API code that says nothing about who must do what. It actually means the MEMBER is a single-channel guest, which Slack caps at one channel, so no bot permission can fix it: a workspace admin has to change their account type. explainSlackError() now maps the common codes to a sentence naming the channel and the required action: user_is_ultra_restricted (single-channel guest -> admin must upgrade the account type), user_is_restricted, is_archived (drop it from the configured list), channel_not_found (bad id or private + bot cannot see it), not_in_channel (/invite @BBQs), cant_invite_self. Unknown codes still pass through verbatim rather than being swallowed.
… instead of one-by-one
Inviting guests one at a time meant discovering "not in the workspace" per person, mid-flow.
A new "Slack invites" button collects everyone whose slack step is still open and classifies
them in one pass, then gives each group its batch action:
- NOT in the workspace -> "Copy all emails" (comma-separated) to paste straight into Slack's
Invite people box as a single group invite;
- IN the workspace but missing channels -> "Add all to channels" in one click, then re-checks;
- already complete -> just counted.
Backed by a new action:'bulk_check' on slack-channels: takes people[] (capped at 100, run in
small sequential batches because users.lookupByEmail is rate-limited) and returns
needs_guest_invite / needs_channels / complete, with channel NAMES not ids. Read-only.
tsc clean, guards 3/3.
…ntirely) Correction: Slack membership is not just "everyone-channels + the young-investigator channel". Each working group has its own channel, mirroring the wg-*@ Google Groups -- and the function had no concept of that, so a member's WG channels were never considered. New SLACK_WG_CHANNELS mapping, e.g. "WG-Analytics=C1,WG-Devices=C2|C3,WG-ELSI=C4,WG-Standards=C5" (a group may map to several channels via "|"; the WG token is matched case-insensitively). targetsFor() now computes a member's channels as: everyone-channels + YI channels (postdocs and grad students) + one entry per working group they belong to. Both the single-person resolver and the bulk triage pass working_groups, so "missing" is per-member and correct. Also adds action:'list_channels' -- returns every channel the bot can see (id, #name, private, is_member) plus the CURRENT configured mapping, so channel IDs can be copied from one call instead of hunted down in Slack. tsc clean, guards 3/3.
Adding someone to a working group now adds them to that group's Slack channel, the way Google
Groups already work. New trg_sync_slack_channels fires on the same events and calls
slack-channels with action:'sync'.
Fires on INSERT as well as UPDATE, deliberately: the Google-Group trigger is UPDATE-only, which
is exactly why a member created with working groups already set was never provisioned (the
drift group-audit exists to find). This trigger does not repeat that mistake.
The trigger path is untrusted by design. A DB trigger can only send the public anon key, so the
function IGNORES every value in the body except the email, re-reads role/working_groups with the
service role, and syncs from what the database says; it returns a bare {ok} so the path cannot
be used to probe who is in Slack. Admin/curator JWT is still required for all other actions. A
Slack failure never blocks the profile edit.
Analytics channel #bbqs-wg-analytics (C0BP1AN59CZ) was created, completing the mapping: everyone -> #general; trainees -> #younginvestigators; and one channel per working group. Documented as the source of truth alongside the note that the same lists exist agent-side in consortium_settings and must be kept in sync.
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.
No description provided.