Skip to content

Commit 157bbb2

Browse files
committed
fix(slack): allow standalone workspace sends
1 parent c897423 commit 157bbb2

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎extensions/slack/src/detached-target-admission.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
// Bare detached targets are safe only after auth.test positively identifies a workspace install.
1+
// The Slack monitor owns process-local installation identity. Missing state means the monitor
2+
// never ran, not that the account is Enterprise Grid, so standalone CLI sends retain bare targets.
23
import { getSlackInstallationKind } from "./installation-identity-state.js";
34

45
export function assertSlackDetachedTargetAllowed(accountId: string, teamId?: string): void {
5-
if (getSlackInstallationKind(accountId) !== "workspace" && !teamId) {
6+
const installationKind = getSlackInstallationKind(accountId);
7+
if (installationKind && installationKind !== "workspace" && !teamId) {
68
throw new Error(
79
"unsupported_enterprise_slack_delivery: detached Slack operations require team:<team-id>:channel:<channel-id> or team:<team-id>:user:<user-id> until a workspace install is authenticated",
810
);

‎extensions/slack/src/monitor/provider.auth-test-token.test.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -877,9 +877,7 @@ describe("connected identity health", () => {
877877
lastError: null,
878878
});
879879
expect(getSlackInstallationKind("default")).toBeUndefined();
880-
expect(() => assertSlackDetachedTargetAllowed("default")).toThrow(
881-
"unsupported_enterprise_slack_delivery",
882-
);
880+
expect(() => assertSlackDetachedTargetAllowed("default")).not.toThrow();
883881
});
884882

885883
it("promotes recovered Enterprise identity before dispatching its first event", async () => {

0 commit comments

Comments
 (0)