Skip to content

fix(analytics): default optional builder params to null - #1893

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/analytics-codegen-optional-defaults
Oct 30, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
fix/analytics-codegen-optional-defaults

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Two build-logic problems in the analytics catalogue.

Optional params had no default. KotlinEmitter.builder() emitted nullable params as name: Type? with no default, so adding an optional property to an existing event breaks every Android call site. #1889 (GroupEvents.newOpened()) and #1890 (TransferEvents.sentCash) both had to edit app code for that reason. The emitter now writes = null for every nullable param, including the amount group's optional amount: Amount?, which goes through the same Param. Required params are unchanged. Kotlin/Native's ObjC export drops default arguments, so the Swift API is unchanged.

writeAnalyticsEventsPage + checkAnalyticsEventsPage in one invocation failed. On a clean tree, ./gradlew writeAnalyticsEventsPage checkAnalyticsEventsPage ran the check first and failed with "EVENTS.md is out of date", while each task passes alone. The check task now mustRunAfter the write task.

EVENTS.md is unchanged. AnalyticsCatalogueTest now expects = null on the optional-param and amount-group cases.

Once this merges, the null-passing edits in #1889 and #1890 can be reverted.

The generated builders gave optional properties no default, so adding
an optional property to an existing event broke every call site. Emit
`= null` for nullable params, including the amount group's.

Also order checkAnalyticsEventsPage after writeAnalyticsEventsPage so
both can run in one invocation.
@bmc08gt bmc08gt self-assigned this Oct 30, 2026
@github-actions github-actions Bot added type: fix Bug fix area: build-system Gradle, convention plugins, build-logic labels Oct 30, 2026
@bmc08gt
bmc08gt marked this pull request as ready for review October 30, 2026 03:16
@bmc08gt
bmc08gt merged commit 310c0c0 into code/cash Oct 30, 2026
6 checks passed
@bmc08gt
bmc08gt deleted the fix/analytics-codegen-optional-defaults branch October 30, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build-system Gradle, convention plugins, build-logic type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant