Skip to content

fix(flags): retry flag requests on transient network errors#184

Merged
marandaneto merged 5 commits into
mainfrom
pi-flags-network-retry-20260624
Jun 29, 2026
Merged

fix(flags): retry flag requests on transient network errors#184
marandaneto merged 5 commits into
mainfrom
pi-flags-network-retry-20260624

Conversation

@marandaneto

@marandaneto marandaneto commented Jun 25, 2026

Copy link
Copy Markdown
Member

💡 Motivation and Context

/flags/?v=2 evaluation should tolerate transient network failures, but should not retry HTTP/API responses such as 408, 429, or 5xx.

This PR adds bounded retry/backoff only for transient network failures (timeouts, connection resets/lost connections, and EOF-style failures) and keeps HTTP/API status errors terminal.

💚 How did you test it?

See the repo-specific command below.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Implemented by pi after a maintainer-directed cross-SDK pass. The chosen policy is transient network-only retry/backoff for /flags/?v=2; HTTP/API statuses remain non-retryable by design. Connection-refused failures also fail fast where the platform exposes that distinction.

Tested with:

vendor/bin/phpunit --do-not-fail-on-warning --do-not-fail-on-deprecation --do-not-fail-on-phpunit-deprecation --do-not-fail-on-phpunit-warning test/FeatureFlagTest.php

Note: PHPUnit reported the existing no-code-coverage-driver warning/deprecations, but all 49 tests and 142 assertions completed successfully.

@marandaneto marandaneto self-assigned this Jun 25, 2026
@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown

Reviews (1): Last reviewed commit: "fix: retry feature flag requests on netw..." | Re-trigger Greptile

Comment thread test/FeatureFlagTest.php Outdated
Comment thread test/FeatureFlagTest.php Outdated
@marandaneto marandaneto changed the title fix: retry feature flag requests on network errors fix(flags): retry flag requests on transient network errors Jun 25, 2026
Comment thread lib/Client.php Outdated
@marandaneto marandaneto marked this pull request as ready for review June 26, 2026 14:58
@marandaneto marandaneto requested a review from a team as a code owner June 26, 2026 14:58
@greptile-apps

greptile-apps Bot commented Jun 26, 2026

Copy link
Copy Markdown

Reviews (2): Last reviewed commit: "address pr review feedback" | Re-trigger Greptile

turnipdabeets
turnipdabeets approved these changes Jun 26, 2026
@marandaneto marandaneto merged commit 2f594df into main Jun 29, 2026
22 checks passed
@marandaneto marandaneto deleted the pi-flags-network-retry-20260624 branch June 29, 2026 08:58
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