Skip to content
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

Potential time desync when infinite scrolling #88

Open
GAsplund opened this issue Jun 22, 2024 · 0 comments
Open

Potential time desync when infinite scrolling #88

GAsplund opened this issue Jun 22, 2024 · 0 comments
Labels
backend Issue related to backend code bug Something isn't working

Comments

@GAsplund
Copy link
Member

📝 Describe the bug

There is an edge case in infinite scrolling where posts could have been added or removed after the page has been loaded, potentially causing duplicate posts to show up or posts to be skipped.

🔄 To Reproduce

  1. Start infinite scrolling at least once segment
  2. Create or remove a news post (in a separate tab/window)
  3. Infinite scroll another segment

📷 Screenshots

No response

💡 Additional context

I see two potential solutions to this:

  1. Store when the page was loaded, and filter on posts that were added afterwards
    This only mitigates the effects of creation, and not deletion
  2. Store which news post was loaded last and get posts after that for the next segment
    • If basing this off timestamps, there could be problems with duplicated or skipped posts. This could occur if two (or more) timestamps are equal, which could happen for example if two posts are scheduled for the same time.
    • If basing this off post IDs, assuming IDs not ascending, there could be similar issues if the stored post ID was deleted.
@GAsplund GAsplund added bug Something isn't working backend Issue related to backend code labels Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Issue related to backend code bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant