isar / isar/hive

Receive HiveError on HiveImpl.openLazyBox

Open
#787 0 comments 0 reactions 0 assignees View on GitHub
problem
Dominant language
Dart
Stars
4.4k
Forks
449
PR merge metrics
No merged PRs in 30d

Description

**Steps to Reproduce**
Receive error `HiveError: This should not happen. Please open an issue on GitHub.`

Stack Trace:
```
File "binary_reader_impl.dart", line 249, in BinaryReaderImpl.readFrame
File "frame_io_helper.dart", line 72, in _KeyReader.readKeys
File "frame_io_helper.dart", line 31, in FrameIoHelper.keysFromFile
File "storage_backend_vm.dart", line 84, in StorageBackendVm.initialize
File "hive_impl.dart", line 106, in HiveImpl._openBox
File "hive_impl.dart", line 152, in HiveImpl.openLazyBox
```

**Code sample**
Variable `storeType` is enum. Variable `basePath` is path to documents directory on iOS and Android.

```
String get storeName => _storeName ??= storeType.toString().split('.')[1];
...
box = await Hive.openLazyBox(storeName, path: basePath);
```

**Version**
- Platform: iOS, Android
- Flutter version: 1.22.5
- Hive version: 1.4.1+1

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the stack trace at binary_reader_impl.dart line 249, then follow the key-reading path through frame_io_helper.dart, storage_backend_vm.dart, and hive_impl.dart. Reproduce the failure with the supplied openLazyBox sample on the stated platforms and versions; done means the reported HiveError is explained and the affected opening path behaves correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
database, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.