Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/teams-adapter-fixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bradygaster/squad-sdk': patch
---

Teams adapter: encode channelId in deep-link URL, log warning on icacls failure, add integration tests
6 changes: 4 additions & 2 deletions packages/squad-sdk/src/platform/comms-teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ function saveTokens(tokens: StoredTokens): void {

// Ensure permissions are correct even if file already existed
if (platform() === 'win32') {
execFile('icacls', [TOKEN_PATH, '/inheritance:r', '/grant:r', `${process.env.USERNAME ?? 'CURRENT_USER'}:(R,W)`], () => {});
execFile('icacls', [TOKEN_PATH, '/inheritance:r', '/grant:r', `${process.env.USERNAME ?? 'CURRENT_USER'}:(R,W)`], (err) => {
if (err) console.warn('⚠️ Could not restrict token file permissions:', err.message);
});
} else {
chmodSync(SQUAD_DIR, 0o700);
chmodSync(TOKEN_PATH, 0o600);
Expand Down Expand Up @@ -526,7 +528,7 @@ export class TeamsCommunicationAdapter implements CommunicationAdapter {
// Return stable composite ID so pollForReplies can locate the channel
return {
id: `${this.config.teamId}|${this.config.channelId}`,
url: `https://teams.microsoft.com/l/channel/${this.config.channelId}`,
url: `https://teams.microsoft.com/l/channel/${encodeURIComponent(this.config.channelId)}`,
};
}

Expand Down
Loading
Loading