Skip to content

test(web): harden feed conversion retry and race scenarios#918

Merged
gildesmarais merged 5 commits intomainfrom
port/feed-conversion-test-hardening
Mar 28, 2026
Merged

test(web): harden feed conversion retry and race scenarios#918
gildesmarais merged 5 commits intomainfrom
port/feed-conversion-test-hardening

Conversation

@gildesmarais
Copy link
Copy Markdown
Member

Summary

  • port retry/race hardening tests for feed conversion behavior
  • strengthen API fallback assertions in spec/html2rss/web/api/v1_spec.rb
  • tighten frontend conversion hook retry/error path tests

Validation

  • make ready
  • make dev smoke boot (startup and shutdown successful)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ports and expands test coverage for feed conversion retry/race behavior across the web API and frontend hook logic, while cleaning up an unneeded frontend dependency related to OpenAPI client generation.

Changes:

  • Adjust API spec expectations around URL normalization for feed creation.
  • Add frontend hook tests covering unauthorized failure (no auto-retry) and stale preview update race handling.
  • Remove @hey-api/client-fetch from frontend dependencies and update lockfile accordingly.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
spec/html2rss/web/api/v1_spec.rb Updates the URL normalization spec assertion approach.
frontend/src/tests/useFeedConversion.test.ts Adds tests for unauthorized non-retry behavior and stale preview race handling.
frontend/package.json Drops @hey-api/client-fetch from dependencies.
frontend/package-lock.json Removes @hey-api/client-fetch and reclassifies related packages as dev deps per lockfile updates.
Files not reviewed (1)
  • frontend/package-lock.json: Language not supported

Comment on lines 477 to 482
it 'normalizes hostname-only input to https before feed creation', :aggregate_failures do
allow(Html2rss::Web::AutoSource).to receive(:create_stable_feed).and_call_original

post_feed_request(url: 'example.com/articles', strategy: 'faraday')

expect(Html2rss::Web::AutoSource).to have_received(:create_stable_feed).with(
anything,
'https://example.com/articles',
kind_of(Hash),
'faraday'
)

expect(last_response.status).to eq(201)
json = expect_success_response(last_response)
expect(json.dig('data', 'feed', 'url')).to eq('https://example.com/articles')
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example no longer asserts behavior "before feed creation" (the previous spy on AutoSource.create_stable_feed was removed), so the spec now only verifies the response payload. Either update the example description to reflect what’s actually asserted, or add a black-box assertion that proves the submitted URL was normalized prior to persistence (e.g., by checking the created feed record/token mapping).

Copilot uses AI. Check for mistakes.
@gildesmarais gildesmarais enabled auto-merge (squash) March 28, 2026 02:44
@gildesmarais gildesmarais merged commit 9a91435 into main Mar 28, 2026
12 checks passed
@gildesmarais gildesmarais deleted the port/feed-conversion-test-hardening branch March 28, 2026 02:53
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