fix: cast getRandomValues result and fix CI tsc error detection#963
Merged
fix: cast getRandomValues result and fix CI tsc error detection#963
Conversation
The wrap_unwrap tests called Buffer.from() with getRandomValues() return type (RandomTypedArrays union), which @craftzdog/react-native-buffer doesn't accept. Cast to Uint8Array at the 5 call sites. CI wasn't catching this because bun --filter prefixes tsc output with workspace names, breaking reviewdog's error format pattern. Add set -o pipefail and sed to strip the prefix so errors propagate.
Contributor
🤖 End-to-End Test Results - AndroidStatus: ✅ Passed 📸 Final Test ScreenshotScreenshot automatically captured from End-to-End tests and will expire in 30 days This comment is automatically updated on each test run. |
Contributor
🤖 End-to-End Test Results - iOSStatus: ✅ Passed 📸 Final Test ScreenshotScreenshot automatically captured from End-to-End tests and will expire in 30 days This comment is automatically updated on each test run. |
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.


Summary
Fixes the failed 1.0.16 release — npm published successfully but the git tag/release step failed because the pre-commit hook caught TS errors.
TS fix:
wrap_unwrap.tscallsBuffer.from(plaintext)whereplaintextisgetRandomValues()return type (RandomTypedArraysunion).@craftzdog/react-native-buffer'sBuffer.from()only acceptsBuffer | Uint8Array, not the full union. Cast toUint8Arrayat the 5 call sites since we always passnew Uint8Array()in.CI fix:
bun --filter='*' typescriptprefixes output with workspace names (e.g.react-native-quick-crypto-example typescript: src/file.ts(60,17): error TS2769: ...), which breaks reviewdog's-efmpattern. Errors were being silently ignored. Addedset -o pipefailto propagate tsc exit codes andsedto strip the workspace prefix so reviewdog can parse errors.Test plan
bun tscpasses locally