I have a ListView set up with infinite scroll on a Supabase API call. When I scroll to the end of it, its last call returns a 416 Range Not Satisfiable
response. This makes sense because there are only 17 items and the offset is set to a higher number (my limit of 12 multiplied by 2, the next page index) https://apiurl.supabase.co/rest/v1/item_detail?offset=24&limit=10
If I set the offset so that the last call is offset by the total number of items (https://apiurl.supabase.co/rest/v1/item_detail?offset=17&limit=10
), the last call returns a 206 and an empty array, and no loading indicator shows up.
I'm guessing the loading indicator shows up because the API call isn't returning a 200 response. Is this a bug? How would y'all handle this? I thought about trying to set a max on the offset, equal to the number of items, but that requires knowing how many items there are total. Which, I am getting, but from the API call, so I'd need to add an extra one before to do that. Or is there a way to just hide the loading indicator after the call gets a response, even if it's not a 200? That seems easier 😅
Screenshots:
1) Setting the offset to the total number of items being returned, returns 206 and no loading indicator shows at the top of my list (it's reversed)
2) Setting the offset to 24, returns a 416 and the loading indicator shows up and overstays its welcome
Infinite scroll ListView shows loading indicator when scrolled to the end
Database & APIs
I'm just completely hiding the loading indicator on my ListView for now, so it never shows one. Not ideal, but I don't think the 416 response really affects anything else.
No
3
1 reply