Closed purnimavenkatasubbu closed 5 months ago
Marking this as Urgent.
Hive impl has a check for key length > 255. But it is part of assert and works only in debug mode.
frame.dart from hive impl /// Not part of public API Frame(this.key, this.value, {this.length, this.offset = -1}) : lazy = false, deleted = false { assert(assertKey(key)); //validates for key length and throws exception } @gkc Should we add the check for key length in update handler on server and at_client put ?
I think it needs to go in the at_persistence lib first, since that's where it will end up both on client and server. Then also yes in the update verb handler and at_client's put
Also note that the problem occurs at key lengths of 253 or more. (@purnimavenkatasubbu are keys of length 252 OK?)
I think it needs to go in the at_persistence lib first, since that's where it will end up both on client and server. Then also yes in the update verb handler and at_client's put
Also note that the problem occurs at key lengths of 253 or more. (@purnimavenkatasubbu are keys of length 252 OK?)
I get this issue with key of length 252 characters as well
I think it needs to go in the at_persistence lib first, since that's where it will end up both on client and server. Then also yes in the update verb handler and at_client's put Also note that the problem occurs at key lengths of 253 or more. (@purnimavenkatasubbu are keys of length 252 OK?)
I get this issue with key of length 252 characters as well
key length has to be calculated along with atsign length e.g (random key of length 252 or 253 chars) + atsign length. in both the cases, key length will exceed 255 chars and result in the bug.
I think @purnimavenkatasubbu referring to the absolute length here.
Describe the bug
Restarting the server after inserting a key with 253 characters exits with the following error
SecondaryServerBootStrapper|Uncaught error: HiveError: Cannot read, unknown typeId: 241. Did you forget to register an adapter? StackTrace: #0 BinaryReaderImpl.read (package:hive/src/binary/binary_reader_impl.dart:325:11)
1 CommitOpAdapter.read (package:at_persistence_secondary_server/src/log/commitlog/commit_entry.dart:99:71)
2 BinaryReaderImpl.read (package:hive/src/binary/binary_reader_impl.dart:328:33)
3 BinaryReaderImpl.readEncrypted (package:hive/src/binary/binary_reader_impl.dart:342:24)
4 BinaryReaderImpl.readFrame (package:hive/src/binary/binary_reader_impl.dart:278:26)
5 StorageBackendVm.readValue. (package:hive/src/backend/vm/storage_backend_vm.dart:111:30)