Skip to content

♻️ various improvements to polling - #281

Merged
ianardee merged 1 commit into
mainfrom
fix-polling
Nov 16, 2026
Merged

ianardee merged 1 commit into
mainfrom
fix-polling

Conversation

@ianardee

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

Failed-job exceptions discard API failure details shown by the CLI, and the rewritten polling loop lacks regression coverage for success on the final allowed attempt.

2 open issues
What changed in this PR

This PR refactors V2 asynchronous polling to separate job completion from result retrieval, while updating error handling and shared lint settings.

Changes:

  • Reorganizes polling retries, cancellation checks, and optional webhook waiting.
  • Updates polling type signatures and the retry-exhaustion test assertion.
  • Adjusts RuboCop complexity limits and removes local suppressions.
File Description
spec/​v2/​client_v2_spec.rb Updates the expected retry-exhaustion error message.
sig/​mindee/​v2/​client.rbs Defines signatures for the refactored polling helpers.
lib/​mindee/​v2/​parsing/​job.rb Removes a local complexity suppression.
lib/​mindee/​v2/​parsing/​field/​inference_fields.rb Removes local complexity suppressions.
lib/​mindee/​v2/​client.rb Refactors polling, webhook waiting, and result retrieval.
lib/​mindee/​v1/​parsing/​common/​execution.rb Removes a local complexity suppression.
lib/​mindee/​v1/​client.rb Removes a local complexity suppression.
.rubocop.yml Raises complexity limits and permits optional boolean parameters.

Review effort: Balanced

Comment thread lib/mindee/v2/client.rb Resolved
Comment thread lib/mindee/v2/client.rb 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

Client regression tests are missing for polled jobs returning Failed, including assertions for exception type, job ID, error details or fallback message, and no result request.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment thread lib/mindee/v2/client.rb
Comment on lines +226 to +229
if job_response.job.status == 'Failed'
if job_response.job.error
err_to_raise = Mindee::Error::MindeeHTTPErrorV2.new(job_response.job.error)
raise err_to_raise, "Parsing failed for job #{job_response.job.id}: #{err_to_raise.message}"
@ianardee
ianardee merged commit 0e23a0a into main Nov 16, 2026
89 of 93 checks passed
@ianardee
ianardee deleted the fix-polling branch November 16, 2026 14:04
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