Skip to content

chore(deps): bump protovalidate-kt to 0.1.2 so AccessContext validates - #8

Merged
bmc08gt merged 1 commit into
mainfrom
chore/protovalidate-0-1-2
Sep 4, 2026
Merged

chore(deps): bump protovalidate-kt to 0.1.2 so AccessContext validates#8
bmc08gt merged 1 commit into
mainfrom
chore/protovalidate-0-1-2

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

blob.v1.AccessContext could not be validated. Its scope oneof marks each arm required, and protovalidate-kt 0.1.1 emitted every arm's required check unguarded:

Validators.checkRequired(scopeCase == ScopeCase.CHAT, "chat")?.let { violations += it }
Validators.checkRequired(scopeCase == ScopeCase.PROFILE, "profile")?.let { violations += it }

Setting chat failed as profile: value is required, setting profile failed as chat: value is required, and setting neither failed as both. GetBlobsRequest.context was therefore unusable — code-android-app works around it today by validating the request before attaching a scope, which leaves the context unchecked.

protovalidate-kt 0.1.2 guards each arm's check on that arm being the selected one, and reports an unset oneof once as scope: exactly one field is required in oneof.

Regenerating with 0.1.2 moves exactly one of the 203 generated validators, AccessContextValidator.kt — no other message in this contract has a required oneof arm. No contract change, and Swift is untouched: protovalidate-kt generates Kotlin only.

Wants a 0.4.1 publish once merged; the changelog entry is in this PR.

The scope oneof marks each arm required, and 0.1.1 emitted every arm's
required check unguarded, so whichever arm was set the others reported
"value is required" and no AccessContext could pass client-side validation.
GetBlobsRequest.context was unusable as a result — code-android-app had to
validate the request before attaching a scope.

0.1.2 guards each arm's check on that arm being selected. AccessContextValidator
is the only one of the 203 generated validators whose output changes; no other
message in this contract has a required oneof arm.
@bmc08gt bmc08gt self-assigned this Sep 4, 2026
@bmc08gt
bmc08gt merged commit a27a109 into main Sep 4, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the chore/protovalidate-0-1-2 branch September 4, 2026 02:09
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