Skip to content

Commit 580164c

Browse files
waleedlatif1claude
andcommitted
fix(monday): escape string params in GraphQL, align deleteSubscription with established patterns
- Use JSON.stringify() for groupId in get_items.ts (matches create_item.ts and move_item_to_group.ts) - Use JSON.stringify() for notificationUrl in webhook provider - Remove non-standard getOAuthToken fallback in deleteSubscription to match Airtable/Webflow pattern (credential resolution only, warn and return on failure) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9d05503 commit 580164c

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

apps/sim/lib/webhooks/providers/monday.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const mondayHandler: WebhookProviderHandler = {
114114
Authorization: accessToken,
115115
},
116116
body: JSON.stringify({
117-
query: `mutation { create_webhook(board_id: ${boardIdValidation.sanitized}, url: "${notificationUrl}", event: ${eventType}) { id board_id } }`,
117+
query: `mutation { create_webhook(board_id: ${boardIdValidation.sanitized}, url: ${JSON.stringify(notificationUrl)}, event: ${eventType}) { id board_id } }`,
118118
}),
119119
})
120120

@@ -211,15 +211,6 @@ export const mondayHandler: WebhookProviderHandler = {
211211
)
212212
}
213213

214-
if (!accessToken) {
215-
try {
216-
const fallbackToken = await getOAuthToken(ctx.webhook.userId as string, 'monday')
217-
if (fallbackToken) accessToken = fallbackToken
218-
} catch {
219-
// Non-fatal — fall through to the guard below
220-
}
221-
}
222-
223214
if (!accessToken) {
224215
logger.warn(
225216
`[${ctx.requestId}] No access token available for Monday webhook deletion ${externalId} (non-fatal)`

apps/sim/tools/monday/get_items.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export const mondayGetItemsTool: ToolConfig<MondayGetItemsParams, MondayGetItems
8383
const limit = params.limit ?? 25
8484
if (params.groupId) {
8585
return {
86-
query: `query { boards(ids: [${params.boardId}]) { groups(ids: ["${params.groupId}"]) { items_page(limit: ${limit}) { items { id name state board { id } group { id title } column_values { id text value type } created_at updated_at url } } } } }`,
86+
query: `query { boards(ids: [${params.boardId}]) { groups(ids: [${JSON.stringify(params.groupId)}]) { items_page(limit: ${limit}) { items { id name state board { id } group { id title } column_values { id text value type } created_at updated_at url } } } } }`,
8787
}
8888
}
8989
return {

0 commit comments

Comments
 (0)