Skip to content

♻️ various improvements to polling - #281

Open
ianardee wants to merge 1 commit into
mainfrom
fix-polling
Open

ianardee wants to merge 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
"Job ID #{job_response.job.id} completed processing at: #{job_response.job.completed_at}"
)

return job_response if !wait_for_webhooks || check_webhooks_done?(job_response)
Comment thread lib/mindee/v2/client.rb
Comment on lines +228 to +229
raise Mindee::Error::MindeeHTTPErrorV2.new(job_response.job.error),
"Parsing failed for job #{job_response.job.id}"

This branch has not been deployed

No deployments
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