CedarCopilot wants to merge 2 commits into staging from fix/slack-bootstrap-participant-order
Live on prod since Wed, 1 of 3 behaviors working
Since the deploy, 182 prod OTEL spans matching linkSlackChannelOnly ran with 0 error spans. In the 26h before the deploy the same surface ran 365 OTEL spans with 0 error spans. Confidence is medium because the surface was already clean before the deploy, so this confirms no.
Libra has verdicts on 1 of 3 tracked behaviors on prod; 2 are still being checked. Libra checks hourly for 3 days after each deploy.
Follow-up to #2597, from Greptile's review of it. The bootstrap landed in the wrong order, so the feature it was meant to enable still did not work.
recordSlackChannelParticipants is an INSERT ... SELECT c.id FROM channel_containers c. With no container row, the SELECT matches nothing and it writes zero participants.
In #2597 that call ran before the bootstrap. So on exactly the uningested channels the bootstrap exists to onboard, the container was created empty , and the link ladder reads channel_container_participants to derive the counterparty domain (link-runner.ts:337), so those channels still could not link. The bootstrap created a row and changed nothing else.
It would have self-healed on a second run, once the container existed , but a one-shot channels sync-slack reports 0 linked and looks broken.
Reorder , resolve-or-bootstrap the container first, then record participants. That is the whole fix; the identity needed to create the container never depended on the participants.
Honest count , recordSlackChannelParticipants counted written += 1 per attempted participant regardless of what the database did, so it reported a healthy participant total for a container that had none. That is why an empty container was invisible rather than obvious. It now sums real rowCount.
3 new. Verified they fail against the old counting (1 failed / 2 passed with the old written += 1 restored) and pass with the fix.
Credit to Greptile for catching this , it was a P1 on a PR I had already reviewed and merged.
š¤ Generated with Claude Code
This PR reorders Slack link-only onboarding so the channel container exists before participants are persisted, and changes participant reporting to count database writes.
This PR should not merge until participant writes are restricted to the resolved container and affected-row counting uses a result shape supported by the real database adapters.
The reordered bootstrap path can contaminate participant evidence across organizations sharing a Slack Connect channel, while successful database writes are incorrectly reported as zero because the implementation reads an unreliable result field.
Files Needing Attention: apps/server/src/services/integrations/slack/slack-sync.ts, apps/server/src/services/channels/adapters/slack-evidence.ts, and the participant-count test
The participant INSERT is not scoped to the resolved container or organization. For Slack Connect channels shared across organizations, the newly reachable bootstrap path can persist one organization's fetched participant evidence into another organization's container. How this was verified: The resolved container is user-scoped, but the subsequent INSERT SELECT matches all containers sharing the channel ID and account reference without an organization or container-ID predicate.
| Filename | Overview |
|---|---|
| apps/server/src/services/integrations/slack/slack-sync.ts | Corrects bootstrap ordering, but the newly effective participant write can target matching containers outside the resolved organization. |
| apps/server/src/services/channels/adapters/slack-evidence.ts | Adds affected-row accounting through a result field unsupported by the actual database adapters while retaining an organization-unscoped INSERT SELECT. |
| apps/server/src/services/c |
Libra has not measured any production surfaces for this change yet.