Skip to content

fix(connectors): honor provider retry deadlines - #7211

Merged
waleedlatif1 merged 2 commits into
stagingfrom
codex/connector-403-investigation
Aug 28, 2026
Merged

fix(connectors): honor provider retry deadlines#7211
waleedlatif1 merged 2 commits into
stagingfrom
codex/connector-403-investigation

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • preserve upstream retry deadlines after an in-process retry budget exits so scheduled connector syncs do not retry before provider resets
  • share bounded retry-error construction and surface rate-limit failures without exposing provider response bodies
  • distinguish empty Atlassian site grants from malformed discovery responses with actionable reconnect guidance

Type of Change

  • Bug fix

Testing

  • 313 targeted connector, retry, and discovery tests
  • bun run type-check in apps/sim
  • bun run lint
  • bun run check:audits (38/38)

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 28, 2026 9:10am

Request Review

@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR preserves validated provider retry deadlines when scheduling failed connector syncs, centralizes sanitized retryable HTTP error construction, and improves Atlassian discovery diagnostics.

  • Applies provider retry deadlines as a bounded lower limit on connector failure backoff.
  • Cancels omitted rate-limit response bodies before creating sanitized errors.
  • Validates Atlassian accessible-resource entries and distinguishes malformed responses from empty grants.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/lib/atlassian/discovery.ts Validates accessible-resource entries before selection and gives distinct diagnostics for malformed payloads and credentials with no site grants.
apps/sim/lib/knowledge/connectors/sync-engine.ts Propagates validated retry delays through connector failures and bounds scheduling between the existing failure ladder and one-day ceiling.
apps/sim/lib/knowledge/documents/utils.ts Centralizes bounded retryable HTTP error creation, sanitizes rate-limit diagnostics, cancels omitted bodies, and exposes retry delays through error cause chains.
apps/sim/lib/knowledge/documents/secure-fetch.server.ts Reuses the shared retryable HTTP error builder for SSRF-safe connector requests.
apps/sim/lib/knowledge/documents/utils.test.ts Covers sanitized rate-limit errors, response-body cancellation, retry-deadline extraction, and invalid deadline rejection.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Connector HTTP request] --> B{Retryable response?}
  B -- No --> C[Return response]
  B -- Yes --> D{Rate limited?}
  D -- Yes --> E[Cancel response body]
  D -- No --> F[Read bounded diagnostic body]
  E --> G[Create sanitized HTTP error]
  F --> G
  G --> H[Attach validated retry deadline]
  H --> I[In-process retry budget]
  I --> J{Eventually succeeds?}
  J -- Yes --> K[Complete sync]
  J -- No --> L[Connector failure update]
  L --> M[Schedule at max of failure backoff and bounded provider deadline]
Loading

Reviews (2): Last reviewed commit: "fix(connectors): validate retry response..." | Re-trigger Greptile

Comment thread apps/sim/lib/atlassian/discovery.ts Outdated
Comment thread apps/sim/lib/knowledge/documents/utils.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 7 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/atlassian/discovery.ts Outdated
Comment thread apps/sim/lib/knowledge/documents/utils.ts
@waleedlatif1
waleedlatif1 force-pushed the codex/connector-403-investigation branch from aef04c8 to 24ec909 Compare August 28, 2026 09:09
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 28, 2026

Copy link
Copy Markdown

@cubic

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit a96ea5c into staging Aug 28, 2026
27 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/connector-403-investigation branch August 28, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant