Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d97a8ac572
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .int() | ||
| .transform((val) => [val]), | ||
| z.array(z.number().int()), | ||
| z.record(z.string(), z.number()).transform((val) => Object.keys(val)), |
There was a problem hiding this comment.
Convert object vote choices to integers
When Snapshot stores a vote choice as an object (e.g. approval/weighted formats like { "1": 1 }), this branch returns Object.keys(val), which is always a string[]. That violates this endpoint’s declared choice: [Int]! contract and changes runtime payloads from numeric choices to strings for exactly the inputs this commit is trying to support, so consumers that rely on integer arrays will receive the wrong type.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a824095342
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .transform((val) => [val]), | ||
| z.array(z.number().int()), | ||
| .transform((val) => [val.toString()]), | ||
| z.array(z.string()), |
There was a problem hiding this comment.
Accept numeric-array vote choices
This schema now only accepts z.array(z.string()) for array-form choices, but Snapshot approval/ranked-choice votes are commonly stored as numeric arrays (e.g. [1, 2]). Those rows will fail OffchainVotesResponseSchema.parse(...) and make /offchain/votes and /offchain/proposals/{id}/votes return 500 whenever such votes are present. Keep supporting numeric arrays (or transform them) to preserve compatibility with existing offchain vote data.
Useful? React with 👍 / 👎.
| z.array(z.number().int()), | ||
| .transform((val) => [val.toString()]), | ||
| z.array(z.string()), | ||
| z.record(z.string(), z.number()).transform((val) => Object.keys(val)), |
There was a problem hiding this comment.
Filter zero-weight entries from object choices
Mapping object-form choices with Object.keys(val) treats every key as selected, even when its weight is 0; this produces incorrect displayed choices for weighted/quadratic votes when the stored payload includes zero-value options. Because weighted vote payloads can include all choice keys with zero defaults, this branch should filter by positive weight before extracting keys to avoid misreporting voter intent.
Useful? React with 👍 / 👎.
No description provided.