Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseDeltaFunctionResponse breaking change introduced in 5.57.0 #2688

Open
tbithell opened this issue Sep 30, 2024 · 2 comments
Open

BaseDeltaFunctionResponse breaking change introduced in 5.57.0 #2688

tbithell opened this issue Sep 30, 2024 · 2 comments
Labels

Comments

@tbithell
Copy link

Describe the bug

This code works in 5.56.1 and earlier, but breaks in 5.57 with - System.ArgumentException : The Parsable does not contain a collection property

`var pageIterator = PageIterator<DriveItem, BaseDeltaFunctionResponse>.CreatePageIterator(
appGraphServiceClient,
deltaGetResponse,
(driveItem) =>
{
allDriveItems.Add(driveItem);
return true;
},
(request) =>
{
deltaToken = DeltaHttpHelper.GetQueryStringValueFromURI(request.URI.AbsoluteUri, Utils.Constants.Token);
return request;
});

await pageIterator.IterateAsync();`

Expected behavior

My integration tests should continue to work properly as they did before upgraded to 5.57

How to reproduce

After getting DriveItem DeltaQuery results create a pageiterator with the following code in 5.56.1 and then again in 5.57. It will work fine in 5.56.1 and fail in 5.57

`var pageIterator = PageIterator<DriveItem, BaseDeltaFunctionResponse>.CreatePageIterator(
appGraphServiceClient,
deltaGetResponse,
(driveItem) =>
{
allDriveItems.Add(driveItem);
return true;
},
(request) =>
{
deltaToken = DeltaHttpHelper.GetQueryStringValueFromURI(request.URI.AbsoluteUri, Utils.Constants.Token);
return request;
});

await pageIterator.IterateAsync();`

SDK Version

5.57

Latest version known to work for scenario above?

5.56.1

Known Workarounds

None

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
@tbithell tbithell added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Sep 30, 2024
@andrueastman
Copy link
Member

Thanks for raising this @tbithell

I believe this is caused by this PR - microsoftgraph/msgraph-sdk-dotnet-core#903 that changes the reflection usage in library and looks like this affects BaseDeltaFunctionResponse model as it does not contain a Value property(it is added by derived instances).

public partial class BaseDeltaFunctionResponse : IAdditionalDataHolder, IBackedModel, IParsable

Ideally, using BaseDeltaFunctionResponse as the type parameter would be incorrect as the collection property of the response will have no type/property information to be deserialized into and would cause problems.

Out of curiosity does this work out for you when you use the DeltaGetResponse as the type parameter instead? Is there a specific reason to use the base class here?

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Oct 1, 2024
@tbithell
Copy link
Author

tbithell commented Oct 1, 2024

I'll give that a shot. The reason we use the base is we are using the same method to create a PageIterator for both a DeltaGetResponse and a DeltaWithTokenGetResponse.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants