fix(api): make request ID helpers typed-nil safe - #18
Merged
Conversation
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.
Linked Issue
Fixes #17
Summary
RequestIDhelpers detect typed nil contextsRequired Format
feat/,fix/,docs/,test/,refactor/,perf/,security/,chore/,ci/,build/,release/, orrevert/.fix(consensus): reject equivocated proposer slots.Scope And Project Status
No performance claim or user-facing capability is introduced.
Protocol, Safety, And Compatibility
Apply.This changes only invalid local helper input handling. Literal nil and valid contexts retain their existing behavior; a typed nil now returns
""instead of reaching a possible nil-receiver panic. There are no runtime users or compatibility requirements.Validation
git diff --checkpython3 scripts/check_docs.pygo mod verifyand a cleango mod tidydiffgo vet ./...go test -count=1 -mod=readonly ./...go test -race -count=1 -mod=readonly ./...python3 scripts/check_go_architecture.pyAdditional focused validation:
go test -count=100 ./pkg/api/httpserver ./pkg/api/grpcservergo test -race -count=100 ./pkg/api/httpserver ./pkg/api/grpcserveramd64andarm64static builds with-trimpathProtocol, storage, Byzantine, partition, snapshot, and chaos suites are not applicable to this two-helper input-validation fix.
Risk And Rollback
Risk is minimal and limited to callers that supplied a typed nil context and relied on undefined panic-prone behavior. No successful path changes.
Rollback by reverting this commit; no schema, dependency, data, listener, or migration is involved.