Skip to content

Checking ITruncatedCollecton.IsTruncated after enumeration. Fixes #1384 #1393

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

Merged
merged 4 commits into from
Feb 6, 2025

Conversation

uffelauesen
Copy link
Contributor

This PR fixes #1384

The reading of ITruncatedCollection.IsTruncated (used by ODataResourceSetSerializer for nested resource sets) is postponed until after enumeration have completed.

This change is to support other implementations of ITruncatedCollection than the List based TruncatedCollection. Other implementations might not have the collection in memory when before enumeration starts and thus might not know if the data has been truncated like the List based one.

Some tests have been added - both my attempt to write a unittest with Mocks and an E2E test.

WanjohiSammy
WanjohiSammy previously approved these changes Jan 18, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataResourceSetSerializer.cs: Evaluated as low risk
  • test/Microsoft.AspNetCore.OData.Tests/Formatter/Serialization/SerializationTestsHelpers.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)

test/Microsoft.AspNetCore.OData.E2E.Tests/ServerSidePaging/ServerSidePagingDataModel.cs:108

  • The Dispose method is empty. If the class implements IDisposable, it should properly dispose of any unmanaged resources.
public void Dispose()

@rpallares
Copy link
Contributor

Hi,

Is that MR (and a few other you propose that looks related) are in definitive to locally fix the server-driven paging feature that drastically reduce performances ?

See also #1271 (comment)

I believe your recent PR they could help a lot for that topic.

@uffelauesen
Copy link
Contributor Author

Hi @WanjohiSammy
I noticed that the pipeline failed as my added test failed.
I have fixed the test so I would expect the pipeline to be all green.
Please have a look again.
Thanks

gathogojr
gathogojr previously approved these changes Feb 6, 2025
WanjohiSammy
WanjohiSammy previously approved these changes Feb 6, 2025
@gathogojr gathogojr dismissed stale reviews from WanjohiSammy and themself via ed58c00 February 6, 2025 06:55
WanjohiSammy
WanjohiSammy previously approved these changes Feb 6, 2025
@WanjohiSammy WanjohiSammy requested a review from Copilot February 6, 2025 06:57
gathogojr
gathogojr previously approved these changes Feb 6, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • test/Microsoft.AspNetCore.OData.E2E.Tests/ServerSidePaging/ServerSidePagingControllers.cs: Evaluated as low risk
  • test/Microsoft.AspNetCore.OData.Tests/Formatter/Serialization/ODataResourceSetSerializerTests.cs: Evaluated as low risk

@gathogojr gathogojr dismissed stale reviews from WanjohiSammy and themself via 07e6294 February 6, 2025 07:15
@gathogojr gathogojr merged commit 1393c0a into OData:main Feb 6, 2025
4 checks passed
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.

NextLinks (paging) of expanded child collections are resolved before enumeration
4 participants