isar / isar/hive

type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype<…>

Open
#260 3 comments 1 reaction 1 assignee Claimed by @simc View on GitHub
problem
Dominant language
Dart
Stars
4.4k
Forks
449
PR merge metrics
No merged PRs in 30d

Description

```
Future saveTagVersion(List data) async {
Box b = Hive.box(hiveTagVersion);
// b.deleteAll(b.keys);
await b.clear();
await b.addAll(data);
// await b.compact();
print(b.get(0));
Box b2 = Hive.box(hiveTagVersion);
print(b2.get(0));
await b.close();
await Hive.openBox(hiveTagVersion);
Box b3 = Hive.box(hiveTagVersion);
print(b3.keys);
print(b3.values);

return true;
}
```
**Steps to Reproduce**
b and b2 are all right, but b3.values or get will throw the exception after reopen box as TagVersion...
```
flutter: \^[[38;5;196m├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄<…>
flutter: \^[[38;5;196m│ ⛔ ══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞══════════════════════<…>
flutter: \^[[38;5;196m│ ⛔ The following _CastError was thrown:<…>
flutter: \^[[38;5;196m│ ⛔ type '_InternalLinkedHashMap' is not a subtype<…>
flutter: \^[[38;5;196m│ ⛔ of type 'TagVersion' in type cast<…>
flutter: \^[[38;5;196m│ ⛔ <…>
flutter: \^[[38;5;196m│ ⛔ When the exception was thrown, this was the stack:<…>
flutter: \^[[38;5;196m│ ⛔ #0 Keystore.getValues. (package:hive/src/box/keystore.dart:122:45)<…>
flutter: \^[[38;5;196m│ ⛔ #1 MappedIterator.moveNext (dart:_internal/iterable.dart:395:18)<…>
flutter: \^[[38;5;196m│ ⛔ #2 _iterablePartsToStrings (dart:collection/iterable.dart:320:13)<…>
flutter: \^[[38;5;196m│ ⛔ #3 IterableBase.iterableToShortString (dart:collection/iterable.dart:240:7)<…>
flutter: \^[[38;5;196m│ ⛔ #4 Iterable.toString (dart:core/iterable.dart:669:37)<…>
flutter: \^[[38;5;196m│ ⛔ #5 _StringBase._interpolateSingle (dart:core-patch/string_patch.dart:826:17)<…>
flutter: \^[[38;5;196m│ ⛔ #6 print (dart:core/print.dart:11:26)<…>
flutter: \^[[38;5;196m│ ⛔ #7 MyHive.saveTagVersion (package:sign_pad/core/help/hbox.dart:88:5)<…>
flutter: \^[[38;5;196m│ ⛔ <…>
flutter: \^[[38;5;196m│ ⛔ #8 SplashPresenterImpl.loadTagVersion... (package:sign_pad/ui/splash/splash_presenter.dart:101:26)<…>
flutter: \^[[38;5;196m│ ⛔ #11 AsyncAction._runUnary (package:mobx/src/api/async/async_action.dart:57:29)<…>
flutter: \^[[38;5;196m│ ⛔ #19 MyHive.getTagVersion (package:sign_pad/core/help/hbox.dart)<…>
flutter: \^[[38;5;196m│ ⛔ #23 AsyncAction._runUnary (package:mobx/src/api/async/async_action.dart:57:29)<…>
flutter: \^[[38;5;196m│ ⛔ #31 BoxBaseImpl.clear (package:hive/src/box/box_base_impl.dart)<…>
flutter: \^[[38;5;196m│ ⛔ #35 AsyncAction._runUnary (package:mobx/src/api/async/async_action.dart:57:29)<…>
flutter: \^[[38;5;196m│ ⛔ #43 StorageBackendVm.clear. (package:hive/src/backend/vm/storage_backend_vm.dart)<…>
flutter: \^[[38;5;196m│ ⛔ #47 AsyncAction._runUnary (package:mobx/src/api/async/async_action.dart:57:29)<…>
flutter: \^[[38;5;196m│ ⛔ #56 AsyncAction._run (package:mobx/src/api/async/async_action.dart:44:29)<…>
flutter: \^[[38;5;196m│ ⛔ (elided 45 frames from package dart:async and package dart:async-patch)<…>
flutter: \^[[38;5;196m│ ⛔ ═════════════════════════════════════════════════════════════════<…>
flutter: \^[[38;5;196m│ ⛔ <…>
flutter: \^[[38;5;196m└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>

```

**Version**
- Platform: iOS
- Flutter version:1.12.13+hotfix.8
- Hive version: 1.4.1+1

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.