-
Notifications
You must be signed in to change notification settings - Fork 4
fix: add context to error messages for better debugging #126
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
Open
jgowdy-godaddy
wants to merge
14
commits into
main
Choose a base branch
from
improve-error-context
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
- Add RequireParameterStringWithLength to get string and length in one call - Reduces N-API boundary crossings from 2-3 to 1 for partition ID validation - Same functionality, better performance by eliminating duplicate GetUtf8StringLength calls
- Add RequireParameterStringWithLength to get string and length in one call - Add optional utf8_length parameter to CobhanBufferNapi constructors and copy_from_string - Add optional utf8_length parameter to StringToAllocationSize - Update BeginEncryptToJson/BeginDecryptFromJson to return partition_id_length - Reduces redundant GetUtf8StringLength calls when validating empty partition IDs - Foundation for further optimization to eliminate all redundant string length calls
- Pass partition_id_length through all async methods to avoid redundant GetUtf8StringLength calls - Update stack allocation cases to use pre-calculated length for StringToAllocationSize - Reduces N-API boundary crossings from 2-3 to 1 for partition ID validation This completes the optimization suggested in PR feedback to calculate string length once during validation and reuse it throughout the operation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add missing await to assert_throws_async calls in multiple test functions
- Fix assert_encrypt_string to handle empty strings correctly
(indexOf('') always returns 0, not -1)
These tests were incorrectly passing because the async assertions
were not being awaited, causing the test to complete before the
assertion could fail.
Note: Empty content encryption is actually allowed by Asherah,
so these tests pass even with the fixes.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Document all remaining issues found after implementing fixes across branches: - Integer overflow vulnerabilities in size calculations - Stack overflow risk in SCOPED_ALLOCATE - Buffer underflow in AllocationSizeToMaxDataSize - Performance optimization opportunities - Testing gaps and API design issues - Build system improvements This report prioritizes issues by severity and provides specific fixes for each issue identified. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
The stack allocation via alloca() is working as designed: - Default maximum_stack_alloc_size is 2048 bytes (reasonable) - Users can adjust at their own risk - This is an intentional performance optimization Updated report to show only 3 critical issues instead of 4. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Mark issue #10 (Missing Move Semantics) as fixed and add the add-move-optimizations branch to the list of implemented fixes. Updated summary to show 18 remaining issues (down from 19) and list all 7 branches with fixes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add function names to all CobhanBuffer error messages - Include operation context (e.g., 'CobhanBuffer::set_data_len_bytes') - Add clarification about limits (e.g., '2GB limit') - Use consistent error handling pattern with NapiUtils::ThrowException This makes debugging easier by clearly identifying which operation failed and why, especially useful when errors bubble up through the stack.
04d9333 to
5c2ccbd
Compare
c517e9f to
cfbb8a1
Compare
Force use of installed Go version (1.24.0) instead of allowing automatic download of Go 1.24.1 which causes version mismatch errors in CI.
Prevent version conflict error when dry-running npm publish since the package.json version is 0.0.0 but published version is 3.0.8.
The CI npm version requires a tag when the package.json version (0.0.0) is lower than the published version (3.0.8), even for dry-run.
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.
Summary
Changes
napi_throw_errorwithNapiUtils::ThrowExceptionExamples
Before:
After:
Benefits
Test plan
🤖 Generated with Claude Code