Skip to content

Comments

[Dart] Actually use resized FlexBuffers buffer#8929

Closed
greenrobot-team wants to merge 1 commit intogoogle:masterfrom
objectbox:dart-fix-flexbuffer-resize
Closed

[Dart] Actually use resized FlexBuffers buffer#8929
greenrobot-team wants to merge 1 commit intogoogle:masterfrom
objectbox:dart-fix-flexbuffer-resize

Conversation

@greenrobot-team
Copy link
Contributor

When building a FlexBuffer using the Dart Builder API and adding data that exceeds the default buffer size (2048 bytes), in the _newOffset() method a larger buffer is created, but never used. This results in a RangeError.

Resolve by actually replacing the too small with the new larger buffer. Add a test that verifies this by adding multiple large strings to a vector.

This was originally reported to us by a user, so additional details can be found in objectbox/objectbox-dart#786 (note that for the reporter the data written that exceeds the buffer size is an integer and in my test a string, so the stack traces and error messages vary slightly).

jtdavis777
jtdavis777 previously approved these changes Feb 19, 2026
@jtdavis777 jtdavis777 enabled auto-merge (squash) February 19, 2026 00:51
@jtdavis777 jtdavis777 added the ready-for-merge This PR has been approved by a maintainer and is ready for merge by a code owner label Feb 19, 2026
@jtdavis777
Copy link
Collaborator

hey @greenrobot-team - for me to merge I need this branch to be up to date with master, but I don't think you have "allow maintainers to make changes" checked. If you wouldn't mind rebasing or updating this, we can try to get it in! note it may take a few attempts if other PRs get merged before I get back to you but after you rebase.

auto-merge was automatically disabled February 23, 2026 05:55

Head branch was pushed to by a user without write access

@greenrobot-team greenrobot-team force-pushed the dart-fix-flexbuffer-resize branch from 4876827 to d15e2c5 Compare February 23, 2026 05:55
@github-actions github-actions bot added the CI Continuous Integration label Feb 23, 2026
@greenrobot-team greenrobot-team force-pushed the dart-fix-flexbuffer-resize branch from d15e2c5 to 2160446 Compare February 23, 2026 05:55
When building a FlexBuffer using the Builder and adding data that exceeds the default buffer size (2048 bytes), in _newOffset() a larger buffer is created, but never used. This results in a RangeError.

Resolve by actually replacing the too small with the new larger buffer. Add a test that verifies this by adding multiple large strings to a vector.
@greenrobot-team greenrobot-team force-pushed the dart-fix-flexbuffer-resize branch from 2160446 to d6c0195 Compare February 23, 2026 05:56
@greenrobot-team
Copy link
Contributor Author

greenrobot-team commented Feb 23, 2026

Rebased! (Sorry, multiple times because a team member changed the master branch of our fork.)

I don't think you have "allow maintainers to make changes" checked

It appears I don't see that option because I am using the fork of our company account. If you think it's better, I can re-submit from a fork on my account and enable the option.

@greenrobot-team
Copy link
Contributor Author

I just went ahead and submitted this from a private fork to allow edits from maintainers: #8935

@greenrobot-team greenrobot-team deleted the dart-fix-flexbuffer-resize branch February 23, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration dart ready-for-merge This PR has been approved by a maintainer and is ready for merge by a code owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants