Skip to content

feat: Add async middleware, HTTP error mapping, schema validation, useragent, and failover - #64

Merged
soulevilx merged 1 commit into
developfrom
feature/3.0-async-schema-ua-failover
Aug 19, 2026
Merged

feat: Add async middleware, HTTP error mapping, schema validation, useragent, and failover#64
soulevilx merged 1 commit into
developfrom
feature/3.0-async-schema-ua-failover

Conversation

@soulevilx

Copy link
Copy Markdown
Contributor

Summary

Recut 3.0.0 so the previously deferred items ship in this major:

  • D1 Async-safe first-party middleware (AsyncMiddlewareInterface) — Guzzle promises chain without wait(). Third-party sync middleware still uses a blocking fallback. Retry delay still sleeps via SleeperInterface.
  • M2 withHttpErrorMapping() / HttpErrorMappingMiddleware — maps HTTP error statuses to HttpResponseException after retry sees the raw status.
  • M6 withJsonSchemaValidation() / JsonSchemaBodyValidator — optional justinrainbow/json-schema (fail closed when missing).
  • U1–U4 withUserAgent(string|callable), withGeneratedUserAgent(), withRotatingUserAgent() — optional jooservices/useragent, never the default identity.
  • T5 withFailoverTransport() — curl ↔ Guzzle (or custom adapters) on transport-level failures only, not HTTP 4xx/5xx.

Checks

  • composer lint:all pass (Docker PHP 8.5)
  • composer test:coverage 98.06%

After this lands on develop: delete GitHub release + tag v3.0.0, cut release/3.0.0 from develop, PR into master, retag v3.0.0.

…eragent, and failover

Include the remaining 3.0 items in the recut: promise-based first-party middleware, status-to-exception mapping after retry, optional JSON Schema body validation, optional jooservices/useragent helpers, and curl/Guzzle transport failover.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@github-actions github-actions Bot added documentation Improvements or additions to documentation source tests dependencies labels Aug 19, 2026
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@soulevilx, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 seconds

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1c7d43f4-ebba-4f36-91ed-cae36f31f4c4

📥 Commits

Reviewing files that changed from the base of the PR and between 7af8655 and 9b739a5.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (56)
  • AGENTS.md
  • CHANGELOG.md
  • README.md
  • UPGRADE-3.0.md
  • composer.json
  • docs/00-architecture/04-modules-and-domains.md
  • docs/00-architecture/business-context-and-goals.md
  • docs/02-user-guide/api-reference.md
  • docs/02-user-guide/classes-reference.md
  • docs/03-examples/08-async-schema-ua-failover.php
  • docs/03-examples/README.md
  • docs/05-maintenance/BACKLOG-POST-2.0.md
  • src/Adapters/Curl/CurlHttpClientAdapter.php
  • src/Adapters/FailoverTransportAdapter.php
  • src/Adapters/MiddlewareTransportAdapter.php
  • src/Client/ClientBuilder.php
  • src/Contracts/AsyncMiddlewareInterface.php
  • src/Middleware/ApiVersionMiddleware.php
  • src/Middleware/AuthenticationMiddleware.php
  • src/Middleware/BulkheadMiddleware.php
  • src/Middleware/CacheMiddleware.php
  • src/Middleware/CircuitBreakerMiddleware.php
  • src/Middleware/CorrelationIdMiddleware.php
  • src/Middleware/DeadlineMiddleware.php
  • src/Middleware/FallbackMiddleware.php
  • src/Middleware/HttpErrorMappingMiddleware.php
  • src/Middleware/IdempotencyKeyMiddleware.php
  • src/Middleware/InterceptorMiddleware.php
  • src/Middleware/LoggingMiddleware.php
  • src/Middleware/MetricsMiddleware.php
  • src/Middleware/MiddlewarePipeline.php
  • src/Middleware/OAuthTokenRefreshMiddleware.php
  • src/Middleware/ProgressMiddleware.php
  • src/Middleware/RateLimitMiddleware.php
  • src/Middleware/RequestCoalescingMiddleware.php
  • src/Middleware/RequestSigningMiddleware.php
  • src/Middleware/ResponseValidationMiddleware.php
  • src/Middleware/RetryMiddleware.php
  • src/Middleware/TraceContextMiddleware.php
  • src/Middleware/UserAgentMiddleware.php
  • src/Support/ConnectionReuseTracker.php
  • src/Support/MiddlewarePromise.php
  • src/Validation/JsonSchemaBodyValidator.php
  • src/Validation/ResponseValidationConfig.php
  • tests/Integration/Adapters/CurlMultiBatchClientIntegrationTest.php
  • tests/Unit/Adapters/FailoverTransportAdapterTest.php
  • tests/Unit/Client/ClientBuilderDxTest.php
  • tests/Unit/Client/ClientBuilderNewFeaturesCoverageTest.php
  • tests/Unit/Middleware/AsyncFirstPartyMiddlewareTest.php
  • tests/Unit/Middleware/AsyncMiddlewarePipelineTest.php
  • tests/Unit/Middleware/HttpErrorMappingMiddlewareTest.php
  • tests/Unit/Middleware/InterceptorOnErrorTest.php
  • tests/Unit/Middleware/MiddlewarePipelineCoverageTest.php
  • tests/Unit/Middleware/UserAgentMiddlewareTest.php
  • tests/Unit/Support/MiddlewarePromiseTest.php
  • tests/Unit/Validation/JsonSchemaBodyValidatorTest.php

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

codacy-production Bot commented Aug 19, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 138 complexity · 0 duplication

Metric Results
Complexity 138
Duplication 0

View in Codacy

🟢 Coverage 96.70% diff coverage · -0.24% coverage variation

Metric Results
Coverage variation -0.24% coverage variation (-1.00%)
Diff coverage 96.70% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (7af8655) 3219 3166 98.35%
Head commit (9b739a5) 3653 (+434) 3584 (+418) 98.11% (-0.24%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#64) 515 498 96.70%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@soulevilx
soulevilx merged commit f96dccc into develop Aug 19, 2026
30 checks passed
@soulevilx
soulevilx deleted the feature/3.0-async-schema-ua-failover branch August 19, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies documentation Improvements or additions to documentation source tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant