Repository navigation
feat: add encryption key for React Native - #11736
Conversation
WalkthroughIntroduces optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/driver/react-native/ReactNativeDriver.ts (1)
924-926: Implementation correctly forwards the encryption key.The conditional propagation of
encryptionKeyis implemented correctly and won't affect existing usage.Consider adding validation to ensure the encryption key is a non-empty string:
if (this.options.encryptionKey) { + if (typeof this.options.encryptionKey !== 'string' || this.options.encryptionKey.trim() === '') { + throw new Error('encryptionKey must be a non-empty string') + } options.encryptionKey = this.options.encryptionKey; }This would provide clearer feedback if an invalid key is provided, though the underlying library may also perform its own validation.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/driver/react-native/ReactNativeConnectionOptions.ts(1 hunks)src/driver/react-native/ReactNativeDriver.ts(1 hunks)
🔇 Additional comments (1)
src/driver/react-native/ReactNativeConnectionOptions.ts (1)
29-32: Document encryption library requirements or remove untested code.The
encryptionKeyproperty is syntactically correct, but the implementation is incomplete. While the code passesencryptionKeytoopenDatabase()(ReactNativeDriver.ts, lines 924-925), the standardreact-native-sqlite-storagelibrary does not natively support this parameter.No tests or documentation exist explaining which library fork/version is required for encryption support. Either clarify which library variant supports this feature (e.g., react-native-sqlcipher-storage) with appropriate documentation and tests, or remove this untested code.
commit: |
PR Code Suggestions ✨Latest suggestions up to 2ce80ee
Previous suggestionsSuggestions up to commit 391dea4
Suggestions up to commit 1962bb8
|
|||||||||||||||||||||||||||
PR Code Suggestions ✨No code suggestions found for the PR. |
PR Code Suggestions ✨No code suggestions found for the PR. |
Code Review by Qodo (Alpha)(Review updated until commit 2ce80ee)
✅
🐞 Bug |
gioboa
left a comment
There was a problem hiding this comment.
@HtSpChakradharCholleti Thanks, LGTM 👏
|
Persistent review updated to latest commit 391dea4 |
|
Persistent review updated to latest commit 2ce80ee |
Co-authored-by: gioboa <[email protected]>
Close #11737
Description of change
Pull-Request Checklist
masterbranchFixes #11737Summary by CodeRabbit