Skip to content

Commit c29bc2b

Browse files
committed
fix(jira,outlook): replace raw fetch in downloadJiraAttachments, fix Outlook URL encoding
- Jira: replace bare fetch() with fetchWithRetry in downloadJiraAttachments for retry logic on transient errors and rate limits - Outlook: use URLSearchParams in validateConfig $search URL construction to match buildInitialUrl and produce RFC 3986 compliant encoding
1 parent 441d2a6 commit c29bc2b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

apps/sim/connectors/outlook/outlook.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,12 @@ export const outlookConnector: ConnectorConfig = {
557557
// If a search query is specified, verify it's valid with a dry run
558558
const searchQuery = sourceConfig.query as string | undefined
559559
if (searchQuery?.trim()) {
560-
const searchUrl = `${GRAPH_API_BASE}/messages?$search="${encodeURIComponent(searchQuery.trim())}"&$top=1&$select=id`
560+
const searchParams = new URLSearchParams({
561+
$search: `"${searchQuery.trim()}"`,
562+
$top: '1',
563+
$select: 'id',
564+
})
565+
const searchUrl = `${GRAPH_API_BASE}/messages?${searchParams.toString()}`
561566
const searchResponse = await fetchWithRetry(
562567
searchUrl,
563568
{

apps/sim/tools/jira/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export async function downloadJiraAttachments(
6868
continue
6969
}
7070
try {
71-
const response = await fetch(att.content, {
71+
const response = await fetchWithRetry(att.content, {
7272
headers: {
7373
Authorization: `Bearer ${accessToken}`,
7474
Accept: '*/*',

0 commit comments

Comments
 (0)