aip-dev / google.aip.dev

API Improvement Proposals. https://aip.dev/
Other
1.1k stars 501 forks source link

Question regarding AIP-158 #1004

Open agrprashant opened 1 year ago

agrprashant commented 1 year ago

Got a question related to this part in AIP-158 "The API may return fewer results than the number requested (including zero results), even if not at the end of the collection."

What should be the UI behavior when using a list api with pagination that can return a next_page_token but empty results? Should it show a page with no results, with a link to fetch next page? Or should it try to load the next page until it finds a page with non-zero items.

I guess it should be the former but then the end user experience is not great. Any suggestions?

GregFurmanek commented 1 year ago

I would follow the principle of least astonishment. A UI displaying an empty page with a "Next" button would be pretty surprising to me.