Skip to content

RangeError (byteOffset): Index out of range: index should be less than 2048: 2048 #786

Description

@MinseokKang003

I have Map<String, dynamic> flex property in the entity schema.

When I'm trying to save ~30 UUIDs in this flex field, I'm getting these error logs:

RangeError (byteOffset): Index out of range: index should be less than 2048: 2048
flutter: #0      _byteDataByteOffsetCheck (dart:typed_data-patch/typed_data_patch.dart:5419:5)
typed_data_patch.dart:5419
#1      _ByteDataView.setUint8 (dart:typed_data-patch/typed_data_patch.dart:5115:18)
typed_data_patch.dart:5115
#2      Builder._pushUInt (package:flat_buffers/src/builder.dart:533:17)
builder.dart:533
#3      Builder._writeUInt (package:flat_buffers/src/builder.dart:495:5)
builder.dart:495
#4      Builder._createVector (package:flat_buffers/src/builder.dart:368:9)
builder.dart:368
#5      Builder._endMap (package:flat_buffers/src/builder.dart:441:17)
builder.dart:441
#6      Builder._sortKeysAndEndMap (package:flat_buffers/src/builder.dart:424:5)
builder.dart:424
#7      Builder.end (package:flat_buffers/src/builder.dart:246:7)
builder.dart:246
#8      Builder._add (package:flat_buffers/src/builder.dart:62:7)
builder.dart:62
#9      Builder.buildFromObject (package:flat_buffers/src/builder.dart:30:13)
builder.dart:30
#10     toFlexBuffer (package:objectbox/src/native/bindings/flexbuffers.dart:13:31)
flexbuffers.dart:13
#11     getObjectBoxModel.<anonymous closure> (package:ssadavoca/infrastructure/db/objectbox.g.dart:2079:33)
objectbox.g.dart:2079
#12     Box._put (package:objectbox/src/native/box.dart:25<…>

This is causing severe problems in my production app. If there was a hard size limit on the flex property, the documentation should have stated this.

Is it correct that the flex field has a 2048B size limit? Or is it configurable? Any help would be greatly appreciated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions