Repository navigation
Conversation
CreateContext asserted partition keys with pk.(string), and UpdateContext did the same for id and pk after merging. A non-string value (e.g. numeric id from JSON) panicked instead of returning an error. Validate with nonEmptyString before touching the client on create, and before ReplaceItem on update — the same approach as the DeleteContext id guard. Sibling to tink3rlabs#275.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks for your contribution! |
|
Addressed in 75817ac — verified just now:
One item left as the reviewer framed it: switching Validation: These changes were prepared with AI assistance and validated by running the package tests; not personally reviewed/tested by Daniel. |
Resolve merge conflict in UpdateContext: keep the PR's validated idStr/pkStr (no bare type assertions) and upstream's session-token recording from ReplaceItem.
|
Resolved the merge conflict with upstream main (merge commit 104c45e). The conflict was in UpdateContext: kept this PR's validated Disclosure: this conflict resolution was assisted by AI, reviewed against the PR's intent before pushing. |
Summary
Sibling to #275.
CreateContextasserted partition keys withpk.(string), andUpdateContextdid the same foridandpkafter merging. A non-string value (for example a numeric id from JSON) panicked instead of returning an error.Validate with
nonEmptyStringbefore touching the client on create, and beforeReplaceItemon update — the same approach as the DeleteContext id guard.Test plan
go test ./storage/ -run 'TestNonEmptyString|TestCosmosDBCreateContextRejects'