Skip to content

Handle USPTO ODP timeout failures#26

Merged
srdco merged 2 commits into
masterfrom
codex/github-mention-add-login-rate-limiting,-http-timeouts,-uspt
Jul 1, 2026
Merged

Handle USPTO ODP timeout failures#26
srdco merged 2 commits into
masterfrom
codex/github-mention-add-login-rate-limiting,-http-timeouts,-uspt

Conversation

@srdco

@srdco srdco commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Make optional USPTO ODP enrichment non-blocking so slow or unreachable USPTO endpoints do not turn an otherwise successful OPS family import into a 500 error by catching connection/timeout failures and returning an empty enrichment.

Description

  • Add use Illuminate\Http\Client\ConnectionException; to app/Services/USPTOService.php.
  • Wrap the outbound HTTP flow in USPTOService::getApplicationData() in a try/catch (ConnectionException) and return an empty array on connection/timeout failures.
  • Preserve the existing Http::timeout(10) usage for outbound USPTO requests and ensure timeouts are handled gracefully by the new catch.
  • Add a unit test at tests/Unit/USPTOServiceTest.php that fakes an Http connection timeout and asserts getApplicationData() returns an empty array.

Testing

  • Ran php -l app/Services/USPTOService.php and the file passed PHP lint checks.
  • Ran php -l tests/Unit/USPTOServiceTest.php and the new test file passed PHP lint checks.
  • Attempted to run ./vendor/bin/phpunit --filter USPTOServiceTest but it could not be executed in this workspace because phpunit is not installed, so the unit test was added but not executed here.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f38ac2e810

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/Services/USPTOService.php Outdated
@srdco srdco self-assigned this Jul 1, 2026
@srdco srdco merged commit e76728f into master Jul 1, 2026
@srdco srdco deleted the codex/github-mention-add-login-rate-limiting,-http-timeouts,-uspt branch July 1, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant