Skip to content

Keep an Alpha Vantage rate-limit notice retryable - #64

Merged
thorstenalpers merged 2 commits into
mainfrom
fix/alpha-vantage-review-followup
Sep 20, 2026
Merged

thorstenalpers merged 2 commits into
mainfrom
fix/alpha-vantage-review-followup

Conversation

@thorstenalpers

Copy link
Copy Markdown
Owner

Follow-up to #63.

Changes

  • The negative cases in tests/IntegrationTests/AlphaVantageTests.cs use Assert.CatchAsync instead of Assert.ThrowsAsync. ThrowsAsync matches the exact type, so they fail since a refused request throws the derived FinanceNetAccessDeniedException. CI runs unit tests only and did not show this.
  • The premium marker is now the full sentence "This is a premium endpoint". The rate-limit notice ends with "unlock all premium endpoints", so the shorter marker turned a temporary rate limit into a permanent, non-retried refusal.
  • "rate limit" is recognised as a retryable limit next to the old "higher API call volume" wording. Without it, GetOverviewAsync deserialized the notice to an empty object and threw FinanceNetNoDataException after a single request.
  • The rate-limit test now covers all four methods with a realistic notice, the invalid-key test asserts InnerException is null, and the XML summary on the private ThrowIfRejected became a one-line comment.

No public API change, Constants is internal.

Verification

  • dotnet build Finance.NET.slnx --configuration Release: 0 warnings, 0 errors
  • dotnet test tests/Tests.csproj --configuration Release --filter "TestCategory=Unit": 207 passed, 0 failed
  • Mutation check: with the old "premium endpoint" marker the four RateLimit_IsStillRetried cases fail with FinanceNetAccessDeniedException.
  • Not run: the live Alpha Vantage integration tests. The rate-limit notice text in the test is reproduced from memory, not captured from a live response.

🤖 Generated with Claude Code

thorsten and others added 2 commits September 20, 2026 07:59
Assert.ThrowsAsync matches the exact type, so the negative cases turned
red once #63 made a refused request throw FinanceNetAccessDeniedException.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The notice advertises "premium endpoints", so the "premium endpoint"
marker classified a temporary rate limit as a permanent refusal. The
marker now matches the full sentence. The notice also lacks the old
"higher API call volume" wording, so GetOverviewAsync deserialized it
to an empty object and reported no data without retrying. "rate limit"
is now recognised as a retryable limit in all four methods.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@thorstenalpers
thorstenalpers merged commit 4c0c7b6 into main Sep 20, 2026
5 checks passed
@thorstenalpers
thorstenalpers deleted the fix/alpha-vantage-review-followup branch September 20, 2026 06:01
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.

1 participant