Conversation
…ipher-fix' into feature/isolated-hive-checksum-cipher-fix
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue with checksum cipher handling in IsolatedHive by introducing explicit keyCrc tracking. Previously, IsolatedHive did not properly pass the cipher's key CRC through to the frame reading/writing process, causing compatibility issues with encrypted data.
Changes:
- Added
keyCrcparameter throughout the storage backend and frame I/O infrastructure to properly track cipher key CRCs - Consolidated warning messages into a centralized
HiveWarningclass for better maintainability - Added backwards compatibility logic to read frames written before keyCrc was properly handled
- Added comprehensive integration tests for encrypted IsolatedHive data compatibility
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| hive/lib/src/util/logger.dart | Added HiveWarning class to centralize warning messages and added bigIntWarning and crcRecalculationWarning toggles |
| hive/lib/src/binary/binary_writer_impl.dart | Updated to use centralized warnings and accept keyCrc parameter in writeFrame |
| hive/lib/src/binary/binary_reader_impl.dart | Added keyCrc parameter to readFrame with backwards compatibility fallback |
| hive/lib/src/hive_impl.dart | Moved warning message to HiveWarning class and added keyCrc parameter to box opening methods |
| hive/lib/src/isolate/isolated_hive_impl/impl/isolated_hive_impl_vm.dart | Added keyCrc calculation and passing to isolate handler |
| hive/lib/src/isolate/handler/isolated_hive_handler.dart | Consolidated openBox/openLazyBox handling and added keyCrc parameter passing |
| hive/lib/src/backend/vm/storage_backend_vm.dart | Added keyCrc field and parameter throughout read/write operations |
| hive/lib/src/backend/storage_backend_memory.dart | Added keyCrc parameter to constructor and operations |
| hive/lib/src/io/frame_io_helper.dart | Added keyCrc parameter to frame reading methods |
| hive/test/integration/isolate_test.dart | Added integration tests for encrypted data compatibility and backwards compatibility |
| hive/test/tests/* | Updated test calls to match new signatures with additional null parameters |
Comments suppressed due to low confidence (1)
hive/test/integration/isolate_test.dart:219
- Corrected spelling of 'compatable' to 'compatible'.
test('IsolatedHive data compatable with Hive', () async {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #279 +/- ##
==========================================
+ Coverage 93.60% 93.61% +0.01%
==========================================
Files 64 64
Lines 2612 2617 +5
==========================================
+ Hits 2445 2450 +5
Misses 167 167 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…-checksum-cipher-fix
No description provided.