New .skip() implementation doesn't work with .take()

Hi,

Just updated to new 1.5.0 version with the improvement to .skip() method and noticed that paging stopped working. If I do

realm
    .query<JournalEntryEntity>('TRUEPREDICATE SORT(date DESC, time DESC)')
    .skip(10)
    .take(20)

The first element or the result would be the element on index 0.
If I run the same query but without the .take(), than the result will be properly skipped.

Is there a way to handle such pagination with new .skip() implementation?

This is a bug with the new skip implementation - I filed a bug report here: .skip doesn't work well with .take · Issue #1409 · realm/realm-dart · GitHub.

@nirinchev thanks! I wasn’t sure where to report this :slight_smile:

I opened a pr to fix this. Sorry for the oversight.

@Kasper_Overgard_Nielsen Awesome! Thank you for the fast fix!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.