fix(integrations): harden jira, jsm, ashby, google drive, slack, confluence, notion#4345
fix(integrations): harden jira, jsm, ashby, google drive, slack, confluence, notion#4345waleedlatif1 merged 17 commits intostagingfrom
Conversation
…, slack, confluence, notion Audit and fix contract drift, input validation, and error handling across integrations: - Jira: NaN guards on worklog seconds, JSON.parse try/catch on internal API responses, domain normalization (strip leading https://), JQL injection prevention via project key validation, ADF helper consolidation, /search/jql nextPageToken pagination, defensive .trim() on ID path params, encodeURIComponent on watcher account IDs, resolveAssigneeAccountId helper, parent-as-object wrapping, summary fallback, add read-bulk operation. Restored total field (always null) to preserve contract. - JSM: customer/organization route validation - Ashby: types and tool output cleanup across all 30+ tools - Google Drive: tighter response handling across read/write/share tools - Slack: types and tool fixes (canvas, reactions, messaging, members) - Confluence: update tool and types - Docs: regenerated mdx for all touched integrations
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Confluence space/comment/property operations are made more robust: comment update/delete auto-detects footer vs inline comment endpoints, page property updates can auto-fetch the current version when not provided, and space update/delete uses the REST v1 space-key endpoint and surfaces long-task IDs/links on deletion. Expands tool surface + docs/UX: Google Drive adds Reviewed by Cursor Bugbot for commit 952d1a9. Configure here. |
Greptile SummaryThis PR audits and hardens seven integrations across ~104 files, with the broadest scope on Jira. The changes are generally well-considered: NaN guards on worklog inputs, defensive JSON.parse try/catch on proxy responses, domain normalization, JQL injection prevention via project-key regex, and migration to the newer
Confidence Score: 4/5Safe to merge after the stale-cursor bug in bulk_read.ts is resolved. One P1 logic bug in bulk_read.ts (stale cursor causes incorrect isLast on multi-page results). All other changes are clean hardening with no introduced regressions found. apps/sim/tools/jira/bulk_read.ts — stale pagination cursor on the terminal break. Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant BulkRead as jira_bulk_read
participant Atlassian as Atlassian OAuth Resources
participant JiraAPI as Jira search/jql
Caller->>BulkRead: invoke(domain, projectId, accessToken)
BulkRead->>Atlassian: GET accessible-resources
Atlassian-->>BulkRead: list of sites with IDs
BulkRead->>JiraAPI: GET page 1
JiraAPI-->>BulkRead: issues + pagination token
alt More pages available
BulkRead->>JiraAPI: GET page 2 using token
JiraAPI-->>BulkRead: issues + isLast=true
Note over BulkRead: BUG: break fires before token is updated, output carries stale token, isLast evaluates to false
end
BulkRead-->>Caller: issues + incorrect pagination state
|
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Address greptile review on PR #4345: instead of silently dropping `emails` and falling through to list-customers, return a 400 telling the caller to use `accountIds`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Address greptile review on PR #4345: when Google Drive returns a non-JSON error body, surface the response status/statusText so failures are diagnosable instead of falling through to a generic message. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The update_candidate tool reads params.websiteUrl directly; mapping it to result.website added a confusing dead field. The websiteUrl subBlock auto-passes through with the matching name. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
`mimeType`, `query`, and `pageSize` canonical IDs collided with existing subBlock IDs in the same block (failing the canonical-param validation test). Drop the canonicalParamId from search/get_content single-input fields and route them to tool params explicitly in tools.config.params. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
The candidate-id filter was reintroduced as a valid Ashby subBlock, but the migration map still rewrote it to _removed_filterCandidateId on every workflow load, silently breaking the field. Drop the entry so user values persist. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 5ab87a9. Configure here.
Restore three fields that exist in Ashby's API responses but were dropped during the recent refactor: applicationLimitCalloutHtml on /jobPosting.info, compensation on /job.info (and add the `compensation` expand), and managerId on /user.list. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
Same shared-target hazard as the prior fix: offerApplicationId maps to result.applicationId without an operation guard, so a stale value from list_offers could overwrite the active applicationId on get_application, change_application_stage, or list_interviews. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
Ashby's /location.list accepts includeArchived per the API docs, and the docs page already documents the toggle for list_locations. Add the missing operation value so the toggle renders. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
Block now distinguishes true/false/undefined for notifyUsers, but the route collapsed true and undefined into a no-param request. Forward the explicit true intent so it survives any future API default change or proxy override. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
The alphanumeric regex check above already blocks injection, but quoting the project key matches the pattern used elsewhere (issues/route.ts) and hardens the path against future regex changes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 952d1a9. Configure here.
…luence, notion (#4345) * fix(integrations): validate and harden jira, jsm, ashby, google drive, slack, confluence, notion Audit and fix contract drift, input validation, and error handling across integrations: - Jira: NaN guards on worklog seconds, JSON.parse try/catch on internal API responses, domain normalization (strip leading https://), JQL injection prevention via project key validation, ADF helper consolidation, /search/jql nextPageToken pagination, defensive .trim() on ID path params, encodeURIComponent on watcher account IDs, resolveAssigneeAccountId helper, parent-as-object wrapping, summary fallback, add read-bulk operation. Restored total field (always null) to preserve contract. - JSM: customer/organization route validation - Ashby: types and tool output cleanup across all 30+ tools - Google Drive: tighter response handling across read/write/share tools - Slack: types and tool fixes (canvas, reactions, messaging, members) - Confluence: update tool and types - Docs: regenerated mdx for all touched integrations * fix(ashby): add subblock migrations for removed expand form definition fields * fix(slack): restore canvas_id fallback to data.id for backwards compat Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(jsm): explicit 400 when deprecated `emails` param is sent Address greptile review on PR #4345: instead of silently dropping `emails` and falling through to list-customers, return a 400 telling the caller to use `accountIds`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(google_drive): include HTTP status in fallback error messages Address greptile review on PR #4345: when Google Drive returns a non-JSON error body, surface the response status/statusText so failures are diagnosable instead of falling through to a generic message. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(ashby): drop stray websiteUrl→website remap for update_candidate The update_candidate tool reads params.websiteUrl directly; mapping it to result.website added a confusing dead field. The websiteUrl subBlock auto-passes through with the matching name. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(google_drive): rename canonical params to avoid subBlock ID clash `mimeType`, `query`, and `pageSize` canonical IDs collided with existing subBlock IDs in the same block (failing the canonical-param validation test). Drop the canonicalParamId from search/get_content single-input fields and route them to tool params explicitly in tools.config.params. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(ashby): remove filterCandidateId from removed-subblock migrations The candidate-id filter was reintroduced as a valid Ashby subBlock, but the migration map still rewrote it to _removed_filterCandidateId on every workflow load, silently breaking the field. Drop the entry so user values persist. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(ashby): restore documented response fields dropped during refactor Restore three fields that exist in Ashby's API responses but were dropped during the recent refactor: applicationLimitCalloutHtml on /jobPosting.info, compensation on /job.info (and add the `compensation` expand), and managerId on /user.list. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * correctness * updated types * fix(ashby): gate operation-specific param mappings to prevent stale overwrites Multiple subBlocks share the same target tool param (createdAt is set by appCreatedAt/candidateCreatedAt/noteCreatedAt; candidateId by appCandidateId/ filterCandidateId). Because subBlock values persist across operation switches, a stale value from a prior operation could silently overwrite the correct one. Guard each mapping with an explicit operation check. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(ashby): gate offerApplicationId mapping by operation Same shared-target hazard as the prior fix: offerApplicationId maps to result.applicationId without an operation guard, so a stale value from list_offers could overwrite the active applicationId on get_application, change_application_stage, or list_interviews. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(ashby): include list_locations in includeArchived condition Ashby's /location.list accepts includeArchived per the API docs, and the docs page already documents the toggle for list_locations. Add the missing operation value so the toggle renders. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(jira): forward explicit notifyUsers=true query param on issue update Block now distinguishes true/false/undefined for notifyUsers, but the route collapsed true and undefined into a no-param request. Forward the explicit true intent so it survives any future API default change or proxy override. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(jira): quote project key in JQL to defend against injection * fix(jira): quote project key in bulk_read JQL for defense in depth The alphanumeric regex check above already blocks injection, but quoting the project key matches the pattern used elsewhere (issues/route.ts) and hardens the path against future regex changes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Audit and harden multiple integrations against API contracts, input validation, and error handling.
Jira (largest scope)
timeSpentSecondsin worklog tools/api/tools/jira/{write,update}responses (handles HTML 5xx from proxies)https://) — fixes silent fallback to wrong sitebulk_readtoAdfacross comments/links/transitions)/search/jqlnextPageTokenpagination (deprecated/searchstartAt).trim()on ID path params;encodeURIComponenton watcher account IDsresolveAssigneeAccountIdhelper; parent-as-object wrapping; summary fallbackread-bulkblock operation; removed silentread → bulk_readfallbacktotalfield (always null at runtime) to preserve TS contractOther integrations
.mdxfor all touched integrationsTest plan
https://x.atlassian.netresolves to correct cloudId