-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
incremnenralLoading-pageIndex-fix #3852
incremnenralLoading-pageIndex-fix #3852
Conversation
Thanks RosarioPulella for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
@michael-hawker, should this target |
Hello @michael-hawker! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
@msftbot merge if @azchohfi approves |
Hello @michael-hawker! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
Added comment to #3841, think we should shore up tests here and then audit the desired and current behavior. |
Originally posted by @michael-hawker in #3841 (comment) |
@azchohfi mind taking a quick look at this one? If you think this feels good, I'm good worrying about more tests later and just moving forward. Seems straight-forward enough. |
@HppZ since you filed the original issue, did you want to test this fix with your code? You can find out more about trying preview packages here. If so, let us know here in the PR. We'll try and add a test in the meantime. |
@michael-hawker @HppZ Just added some tests and fixed an issue with multiple requests coming in asynchronously. |
Microsoft.Toolkit.Uwp/IncrementalLoadingCollection/IncrementalLoadingCollection.cs
Outdated
Show resolved
Hide resolved
var result = await Source.GetPagedItemsAsync(CurrentPageIndex++, ItemsPerPage, cancellationToken); | ||
return result; | ||
await _mutex.WaitAsync(); | ||
try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @Sergio0694 added a helper here, but it's in the Media package. Just a note for the future, not sure if we want a TODO here for later. Not worth trying to centralize or expose now.
how about this #3954 |
I think it would be better to open a separate PR for that at this time. I am tracking a few issues with the |
I love this. I would only add a test to test if one of the requests throws an exception. What is the expected behavior? |
UnitTests/UnitTests.UWP/UI/Collection/Test_IncrementalLoadingCollection.cs
Outdated
Show resolved
Hide resolved
@RosarioPulella stylecop is the build CI issue:
|
opertation. Added and cleaned up tests.
@azchohfi @michael-hawker this should be it for this PR, take a look. |
why it is |
@azchohfi we good here? |
Fixes #3841
Only Increment CurrentPageIndex if Source.GetPagedItemsAsync's task completes with RanToCompletion
PR Type
What kind of change does this PR introduce?
What is the current behavior?
CurrentPageIndex
is incremented beforeGetPagedItemsAsync
completes. If it does not complete or fails it is still incremented.What is the new behavior?
CurrentPageIndex
is only incremented onceGetPagedItemsAsync
's Task completes with `RanToCompletion.PR Checklist
Please check if your PR fulfills the following requirements:
Other information