Skip to content

[front] fix: pass auth to buildConsumptionScopeQuery call sites - #30158

Closed
avervaet wants to merge 1 commit into
mainfrom
avervaet/consumption-scope-query-auth-fix
Closed

[front] fix: pass auth to buildConsumptionScopeQuery call sites#30158
avervaet wants to merge 1 commit into
mainfrom
avervaet/consumption-scope-query-auth-fix

Conversation

@avervaet

@avervaet avervaet commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

overview.ts, and timeseries.ts were still calling buildConsumptionScopeQuery with workspaceId, but the function already requires auth. Fixes the type mismatch.

Tests

Risk

Deploy Plan

  • Deploy front

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
playground Ignored Ignored Preview Aug 10, 2026 9:04am
storybook Ignored Ignored Preview Aug 10, 2026 9:04am

Request Review

@dust-agent dust-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Coding rules review for PR #30158.

export function consumptionPeriodKey(
selection: ConsumptionPeriodSelection
): string {
return selection.kind === "cycle" ? "cycle" : `days:${selection.days}`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[GEN6] Prefer exhaustive switch + assertNever over if/else on union types

Same as above — branching on the ConsumptionPeriodSelection discriminated union via a ternary. Use an exhaustive switch with assertNever.

Suggested change
return selection.kind === "cycle" ? "cycle" : `days:${selection.days}`;
export function consumptionPeriodKey(
selection: ConsumptionPeriodSelection
): string {
switch (selection.kind) {
case "cycle":
return "cycle";
case "days":
return `days:${selection.days}`;
default:
return assertNever(selection);
}
}

@avervaet
avervaet force-pushed the avervaet/consumption-scope-query-auth-fix branch from 6260659 to 3bae94d Compare August 7, 2026 10:10
@sfriquet
sfriquet force-pushed the sf/analytics-consumption-attribution-scope-ts branch 5 times, most recently from f39964f to 947b9fb Compare August 7, 2026 20:50
@avervaet
avervaet force-pushed the sf/analytics-consumption-attribution-scope-ts branch from 947b9fb to 9a83044 Compare August 10, 2026 07:21
@avervaet
avervaet force-pushed the avervaet/consumption-scope-query-auth-fix branch from 3bae94d to 21031db Compare August 10, 2026 07:21
@avervaet
avervaet force-pushed the sf/analytics-consumption-attribution-scope-ts branch from 9a83044 to 44cd940 Compare August 10, 2026 08:35
@avervaet
avervaet force-pushed the avervaet/consumption-scope-query-auth-fix branch from 21031db to faabb4a Compare August 10, 2026 08:35
Base automatically changed from sf/analytics-consumption-attribution-scope-ts to main August 10, 2026 08:49
overview.ts, timeseries.ts and top.ts were still calling buildConsumptionScopeQuery
with workspaceId, but the function already requires auth (see scope.ts /
scope.test.ts). Fixes the type mismatch.
@avervaet
avervaet force-pushed the avervaet/consumption-scope-query-auth-fix branch from faabb4a to 120f96f Compare August 10, 2026 09:04
@avervaet avervaet closed this Aug 10, 2026
@avervaet
avervaet deleted the avervaet/consumption-scope-query-auth-fix branch August 10, 2026 09:06
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