Skip to content

Add minAge parameter to scrape (ENG-4073)#2452

Merged
amplitudesxd merged 3 commits intomainfrom
tom/eng-4073-add-minage-parameter-to-scrape
Nov 30, 2025
Merged

Add minAge parameter to scrape (ENG-4073)#2452
amplitudesxd merged 3 commits intomainfrom
tom/eng-4073-add-minage-parameter-to-scrape

Conversation

@amplitudesxd
Copy link
Copy Markdown
Member

@amplitudesxd amplitudesxd commented Nov 28, 2025

Summary by cubic

Adds a minAge option to v2 scrape to require a minimum cache age and avoid re-scraping. If cached data is younger than minAge, the API returns 404 (SCRAPE_NO_CACHED_DATA) without falling back to other engines. Fulfills ENG-4073.

  • New Features

    • minAge added to scrape options (API, JS SDK, Python SDK).
    • Index RPC updated to honor minAge; no engine fallback when minAge is set.
    • New SCRAPE_NO_CACHED_DATA error with 404 handling in the controller.
    • Tests cover cache miss/hit behavior with minAge.
  • Migration

    • Pass minAge in scrape options when you require older cached results.
    • Handle 404 with code SCRAPE_NO_CACHED_DATA in clients.
    • Update SDKs: JS v4.8.0, Python v4.10.0.

Written for commit 42f19c7. Summary will update automatically on new commits.

@amplitudesxd amplitudesxd requested a review from mogery as a code owner November 28, 2025 17:04
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 12 files

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="apps/api/src/__tests__/snips/v2/scrape-cache.test.ts">

<violation number="1" location="apps/api/src/__tests__/snips/v2/scrape-cache.test.ts:145">
Use `scrapeRaw`/`scrapeWithFailure` instead of the success-only `scrape` helper when asserting error responses, otherwise the test throws a Jest assertion before it can inspect the 404 `SCRAPE_NO_CACHED_DATA` response.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

Comment thread apps/api/src/__tests__/snips/v2/scrape-cache.test.ts Outdated
@amplitudesxd
Copy link
Copy Markdown
Member Author

@cubic-dev-ai review this PR

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Nov 28, 2025

@cubic-dev-ai review this PR

@amplitudesxd I've started the AI code review. It'll take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 12 files

@amplitudesxd amplitudesxd merged commit 9f4f011 into main Nov 30, 2025
6 of 9 checks passed
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