[front] fix: pass auth to buildConsumptionScopeQuery call sites - #30158
Closed
avervaet wants to merge 1 commit into
Closed
[front] fix: pass auth to buildConsumptionScopeQuery call sites#30158avervaet wants to merge 1 commit into
avervaet wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
| export function consumptionPeriodKey( | ||
| selection: ConsumptionPeriodSelection | ||
| ): string { | ||
| return selection.kind === "cycle" ? "cycle" : `days:${selection.days}`; |
Contributor
There was a problem hiding this comment.
[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); | |
| } | |
| } |
Contributor
Author
|
This change is part of the following stack:
Change managed by git-spice. |
This was referenced Aug 7, 2026
avervaet
force-pushed
the
avervaet/consumption-scope-query-auth-fix
branch
from
August 7, 2026 10:10
6260659 to
3bae94d
Compare
This was referenced Aug 7, 2026
sfriquet
force-pushed
the
sf/analytics-consumption-attribution-scope-ts
branch
5 times, most recently
from
August 7, 2026 20:50
f39964f to
947b9fb
Compare
avervaet
force-pushed
the
sf/analytics-consumption-attribution-scope-ts
branch
from
August 10, 2026 07:21
947b9fb to
9a83044
Compare
avervaet
force-pushed
the
avervaet/consumption-scope-query-auth-fix
branch
from
August 10, 2026 07:21
3bae94d to
21031db
Compare
avervaet
force-pushed
the
sf/analytics-consumption-attribution-scope-ts
branch
from
August 10, 2026 08:35
9a83044 to
44cd940
Compare
avervaet
force-pushed
the
avervaet/consumption-scope-query-auth-fix
branch
from
August 10, 2026 08:35
21031db to
faabb4a
Compare
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
force-pushed
the
avervaet/consumption-scope-query-auth-fix
branch
from
August 10, 2026 09:04
faabb4a to
120f96f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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