Skip to content

fix(Browser): Infinite scroll not working #1432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 24, 2019

Conversation

douglasmuraoka
Copy link
Contributor

After #1334, the infinite scroll is no longer loading the next set of objects. This commit undoes #1334, and tries another approach in order to fix the original problem.

After parse-community#1334, the infinite scroll is no longer loading the next set of objects. This commit undoes parse-community#1334, and tries another approach in order to fix the original problem.
@douglasmuraoka
Copy link
Contributor Author

@W0lfw00d could you please check if your problem from #1334 is still solved?

@dplewis
Copy link
Member

dplewis commented Dec 24, 2019

I think I can replicate #1334 again. Can you explain the logic behind this in the meantime?

@douglasmuraoka
Copy link
Contributor Author

The objects in the dashboard are ordered by -createdAt by default. So, in order to fetch the next page, we use the createdAt value of the last object fetched so far (which should be lesser than the first object's date) and use it as the starting point for the next query. The change from #1334 was not considering this logic to fetch the next page of objects, thus, the query built to fetch the next objects had incorrect constraints and always resulting in zero objects for the next page.

In addition to that, this logic was not considering that createdAt itself could have a different order than descending, because the descending order was always being applied (as you can see at line 435 in the original file) and it was always trying to fetch objects with lesser createdAt dates than the last object of current page.

@acinader acinader merged commit dcd5edd into parse-community:master Dec 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants