Skip to content

Commit 3a71fb9

Browse files
fix: use WEEKS_QUERY_LIMIT for Step 1 execution dates query
Prevents silent data truncation when a site has many execution rows per date (multiple brands/models/categories). Same rationale as the weeks handler which also needs all rows to extract distinct values. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 017fd2a commit 3a71fb9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/controllers/llmo/llmo-brand-presence.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2595,7 +2595,10 @@ export function createBrandVsCompetitorsHandler(getOrgAndValidateAccess) {
25952595
datesQuery = datesQuery.eq('brand_id', filterByBrandId);
25962596
}
25972597

2598-
const { data: datesData, error: datesError } = await datesQuery.limit(QUERY_LIMIT);
2598+
// Use high row limit — we only extract distinct dates, but the table may have
2599+
// many rows per date (multiple brands/models/categories). Same rationale as
2600+
// WEEKS_QUERY_LIMIT in createBrandPresenceWeeksHandler.
2601+
const { data: datesData, error: datesError } = await datesQuery.limit(WEEKS_QUERY_LIMIT);
25992602

26002603
if (datesError) {
26012604
ctx.log.error(`Brand vs competitors execution dates error: ${datesError.message}`);

0 commit comments

Comments
 (0)