-
Notifications
You must be signed in to change notification settings - Fork 76
OCapN: improved error messages and testing #2772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
5de9cd8
to
3801e42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves error messages and testing support across the codebase by adding error wrapping (with nested causes) and stricter decorator-based validations, as well as expanding test coverage for various codecs and passable values. Key changes include:
- Wrapping codec read/write methods with detailed error messages.
- Updating test expectations to use a new throws utility and a less-strict TextDecoder for fuzz tests.
- Renaming and prefixing codec identifiers for clarity and consistency.
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/ocapn/test/syrup/* | Updated tests to use a non-fatal TextDecoder for fuzz descriptor and standardized error expectations via throws utility |
packages/ocapn/src/syrup/* | Refactored codec implementations with error wrapping and added codec name parameters |
packages/ocapn/src/codecs/* | Improved error chaining, renamed codecs with consistent prefixes, and updated union codec implementations |
packages/ocapn/src/syrup/buffer-reader.js | Fixed a formatting bug in an error message |
packages/ocapn/test/_table.js & _syrup_util.js | Adjusted test table entries and moved utility functions for consistency |
Comments suppressed due to low confidence (2)
packages/ocapn/src/syrup/buffer-reader.js:110
- The error message now includes a closing parenthesis, which fixes the previous formatting issue. Verify that all similar error messages follow this corrected punctuation for consistency.
`End of data reached (data length = ${state.length}, asked index ${index})`
packages/ocapn/test/syrup/_table.js:13
- There is a duplicate table entry with syrup '1-' and value -1n. Confirm whether this duplication is intentional or if the redundant entry should be removed.
{ syrup: '1-', value: -1n },
@erights in order to avoid blocking this PR on |
some small improvements:
related to
@endo/pass-style
support of "selector" (#2774)