Skip to content

♻️ cleanup, harmonize with other SDKs - #505

Merged
ianardee merged 3 commits into
mainfrom
fix-polling
Nov 5, 2026
Merged

ianardee merged 3 commits into
mainfrom
fix-polling

Conversation

@ianardee

@ianardee ianardee commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Description

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires a change to the official Guide documentation.

Copilot AI 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.

🟡 Changes recommended

RAG polling exceeds the configured attempt limit because the retained + 1 offset allows an extra request now that tryCounter starts at zero.

1 open issue
What changed in this PR

This PR cleans up the SDK to align with other SDKs, updating v2 polling and removing v1 workflow-related types and exports.

Changes:

  • Add URL-based job retrieval and use it for v2 polling.
  • Refactor polling counters, error handling, and the product-result polling method name.
  • Remove v1 workflow execution models, options, and parameter types.
File Description
src/​v2/​client.ts Update job retrieval, polling, and failure handling.
src/​v1/​parsing/​common/​index.ts Remove workflow execution exports.
src/​v1/​parsing/​common/​executionPriority.ts Delete the execution priority enum.
src/​v1/​parsing/​common/​executionFile.ts Delete the execution file model.
src/​v1/​parsing/​common/​execution.ts Delete the workflow execution model.
src/​v1/​index.ts Remove the WorkflowOptions export.
src/​v1/​http/​index.ts Remove the WorkflowParams export.
src/​v1/​http/​httpParams.ts Remove workflow request parameters.
src/​v1/​client.ts Remove workflow options and the unused priority import.

Review effort: Balanced

Comment thread src/v2/client.ts Resolved

Copilot AI 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.

🔵 Needs a closer look

The RAG polling loops exceed the documented maxRetries limit by one request and an extra delay because the counter now starts at zero while the limit still adds one.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@ianardee
ianardee force-pushed the fix-polling branch 2 times, most recently from dcb1cd1 to 25d78b8 Compare November 5, 2026 10:25
@ianardee
ianardee requested a balanced review from Copilot November 5, 2026 10:32

Copilot AI 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.

🟡 Changes recommended

Main pushes lose the full-history secret-scanning release gate, removed public workflow exports break existing consumers, and changed polling behavior lacks regression coverage.

1 open issue
3 previously missed issues

In code that hasn't changed since last review

High severity Preserve deprecated workflow exports to avoid breaking consumers

src/​v1/​index.ts:9

These workflow definitions are publicly exported, even though the remaining SDK implementation no longer uses them. Removing them breaks existing consumers referencing types such as v1.WorkflowOptions or values such as v1.parsing.common.ExecutionPriority. For this non-breaking cleanup, retain the definitions and exports as deprecated; otherwise, treat their removal as a breaking SDK release with migration guidance.

Medium severity Test polling with the URL returned by the enqueue response

src/​v2/​client.ts:240

The existing enqueueAndGetResult unit tests all reject during enqueue with HTTP 400, so none exercises this new URL-based polling path; the getJob test only covers lookup by ID. Please add a mocked enqueue/poll/result test whose returned polling URL differs from the URL constructed from the job ID, and assert that polling uses the returned URL. Otherwise, reverting this behavior to ID-based polling would still pass the current tests.

Medium severity Test polling failures after successful enqueue

src/​v2/​client.ts:254

The existing enqueueAndGetResult tests in tests/v2/client/client.spec.ts reject during enqueue, leaving the changed polling-error contract untested. Add a successful enqueue followed by an HTTP 200 job response with status Failed, and assert that MindeeHttpErrorV2 preserves the job's error fields. Also cover the no-detail MindeeError fallback.

Review effort: Balanced

Comment thread .github/workflows/push-main-branch.yml Resolved

Copilot AI 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.

🟡 Changes recommended

Existing enqueueAndGetResult() tests fail during enqueue, leaving no regression coverage that verifies polling the supplied polling_url through completion and fetching the completed job’s result_url.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread src/v2/client.ts Resolved

Copilot AI 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.

🟡 Changes recommended

The refactor removes public types, execution classes, and an enum, breaking existing consumers despite being marked non-breaking; these APIs must be retained or removed in an explicitly breaking release with migration guidance.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread src/v1/index.ts
OptionalAsyncOptions,
PredictOptions,
WorkflowOptions
PredictOptions
@ianardee
ianardee merged commit 1ff4e96 into main Nov 5, 2026
26 checks passed
@ianardee
ianardee deleted the fix-polling branch November 5, 2026 11:06
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.

2 participants