architecture-components-samples icon indicating copy to clipboard operation
architecture-components-samples copied to clipboard

PagingWithNetworkSample: After Paging 3 update, indexInResponse is now unused; Ordering behavior is unclear

Open aconda-mercari opened this issue 3 years ago • 0 comments

I'm trying to understand how to keep the ordering from the backend into Room, and I noticed the variable indexInResponse was used for this exact use case. However, after the paging 3 migration in this codebase, this variable is now unused and returns 0 for all items, although it is still used in ORDER BY in the query.

I need to do exactly this so I want to know whether insertion order is preserved now in Paging 3 making indexInResponse unnecessary. From checking Room-generated I don't see anything like this happening, and as far as I know, SQLite doesn't guarantee this, otherwise, a variable like indexInResponse would not be necessary in the first place even for Paging 2.

Looking for clarification in this scenario, so comments around this are appreciated.

aconda-mercari avatar Mar 12 '22 12:03 aconda-mercari