Skip to content

Conversation

@rodrigoi
Copy link
Contributor

@rodrigoi rodrigoi commented Nov 20, 2025

Problem

The BreakdownKeyType is not great.

export type BreakdownKeyType = integer | string | number | (integer | string | number)[] | null

Ideally, you want your types to be extended via unions or derived via utility types. In the case of BreakdownKeyType, you would like to treat it as a primitive and either allow it to be used as an array or make it nullable in the final type or variable.

Changes

We were inadvertently deriving BreakdownKeyType as an array when it already includes the array form as a union. That was causing some problems with type inference, which we fixed by adding a type assertion.

This change acknowledges the weirdness of BreakdownKeyType and documents why we are using primitives instead when defining breakdown_values.

How did you test this code?

cat-type-small

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Changelog: (features only) Is this feature complete?

@rodrigoi rodrigoi self-assigned this Nov 20, 2025
@wiz-7ad640923b
Copy link

wiz-7ad640923b bot commented Nov 20, 2025

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data 1 Medium
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Total 1 Medium

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@github-actions
Copy link
Contributor

github-actions bot commented Nov 20, 2025

Size Change: 0 B

Total Size: 3.43 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 3.43 MB

compressed-size-action

@PostHog PostHog deleted a comment from greptile-apps bot Nov 20, 2025
@rodrigoi rodrigoi force-pushed the experiments/breakdown-value-type-update branch from d9c7191 to d6ea20f Compare November 20, 2025 23:07
@rodrigoi rodrigoi requested a review from a team November 20, 2025 23:26
@rodrigoi rodrigoi enabled auto-merge (squash) November 21, 2025 07:42
@rodrigoi rodrigoi merged commit 81c3aae into master Nov 21, 2025
201 checks passed
@rodrigoi rodrigoi deleted the experiments/breakdown-value-type-update branch November 21, 2025 12:10
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.

3 participants