woocommerce / woocommerce-ios

WooCommerce iOS app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
313 stars 113 forks source link

[Woo POS] Address edge case when there are no eligible products on first page #14442

Open iamgabrielma opened 3 hours ago

iamgabrielma commented 3 hours ago

From https://github.com/woocommerce/woocommerce-ios/pull/14382#pullrequestreview-2438111323

I found a "fun" edge case...If the first page of results doesn't have any products that pass the filter, we show the empty state... but that means we never load page 2 even if it might have something.

It might be solvable, because I don't think the item provider will tell the aggregate model that there's no more pages in this case... so we could try triggering subsequent page loads until we get the pageOutOfRange error (even though there's no view to trigger those for us) and only show the empty state when we get pageOutOfRange and have an empty allItems array.

dangermattic commented 3 hours ago

Thanks for reporting! 👍