Skip to content

Scope daily ratings/reviews refresh to each app's tracked storefronts#5

Open
dustyberry1 wants to merge 1 commit into
hubab1:mainfrom
dustyberry1:fix/scope-daily-refresh-to-tracked-storefronts
Open

Scope daily ratings/reviews refresh to each app's tracked storefronts#5
dustyberry1 wants to merge 1 commit into
hubab1:mainfrom
dustyberry1:fix/scope-daily-refresh-to-tracked-storefronts

Conversation

@dustyberry1

Copy link
Copy Markdown

The daily refresh built its request with storefrontSelection: .all(codes:) using the full bundled storefront catalog (~174 countries) for every tracked app. Ratings and reviews are fetched per storefront, so the refresh fanned out across all 174 countries regardless of how many the user actually tracked keywords in. For anyone tracking keywords in more than a few countries this made the daily/long refresh time out.

Derive each app's storefront set from the countries it actually tracks keywords in (app.keywordTracks), via a new testable helper DailyRefreshScheduler.ratingsReviewsStorefrontCodes(for:fallback:). Apps with no tracked keywords fall back to the catalog-wide set so current behavior is preserved there.

Add DailyRefreshSchedulerTests covering both the scoped and fallback cases.

The daily refresh built its request with storefrontSelection: .all(codes:)
using the full bundled storefront catalog (~174 countries) for every tracked
app. Ratings and reviews are fetched per storefront, so the refresh fanned out
across all 174 countries regardless of how many the user actually tracked
keywords in. For anyone tracking keywords in more than a few countries this
made the daily/long refresh time out.

Derive each app's storefront set from the countries it actually tracks
keywords in (app.keywordTracks), via a new testable helper
DailyRefreshScheduler.ratingsReviewsStorefrontCodes(for:fallback:). Apps with
no tracked keywords fall back to the catalog-wide set so current behavior is
preserved there.

Add DailyRefreshSchedulerTests covering both the scoped and fallback cases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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