Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@elliette
Copy link
Member

@elliette elliette commented Mar 4, 2023

Fixes #5329

Previously, for objects where there was no explicitly set offset and childCount, we were sending getObject requests with offset set to 0 and count set to the length of the object (if it was a List, Map, Record or Set instance) or 0 if it wasn't.

This was causing the following problem: if we missed any of the instance kinds that had a length (for example, we were missing Set instances), then we would send a getObject request with count equal to 0. The VM service would then correctly respond with an empty object.

This PR does not include offset and count params in getObject requests, unless we are explicitly requesting a partial object.

@elliette elliette requested a review from a team as a code owner March 4, 2023 01:26
@elliette elliette requested review from CoderDake and removed request for a team March 4, 2023 01:26
offset: 2,
count: 4,
);
expect(mapGrouping.isPartialObject, isTrue);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of duplicating all the groups for childCount and isPartialObject, can we just make 'map instances', 'list instances' etc. top level groups for which we check the childCount and isPartialObject values?

also, should we check Set objects too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, refactored the test. Also added test cases for sets

Comment on lines +70 to +73
buildListVariable(),
buildMapVariable(),
buildStringVariable('test str'),
buildBooleanVariable(true),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a Set variable in here too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Done. Refactored a little to avoid test case duplication with verifyGroupings method

@elliette elliette merged commit edb0e3e into flutter:master Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The default count parameter for getObject should be null not 0

2 participants