-
Notifications
You must be signed in to change notification settings - Fork 45
Description
Currently, we have an inconsistency with the replies pagination:
- User A loads the page, and sees a (parent) comment with 5 replies previewed, and a load more button for the remaining e.g. 25 replies.
- User A leaves the page open for 10 minutes before doing anything.
- User B leaves 3 new replies on the same comment that User A is viewing.
- User A clicks "load more". Because of User B's actions, all the existing replies that User A can see have been "shifted" up by 3 positions, but this change is not reflected on their page because we don't auto-reload replies.
- The load more button causes the next page to be loaded, which contains 3 existing comments that User A could already see, because they got shifted upwards. Therefore, duplicate comments are now visible.
This doesn't affect the parent timeline where we request the comments oldest-to-newest from the API. On the replies timeline, we request them newest-to-oldest, causing this problem with shifting. We don't support fully deleting a comment, so this problem cannot happen in the other direction.
A possible solution is to use OpenSearch's Point in Time feature, which is their officially recommended method of pagination. This involves creating a PIT (probably when the first timeline request is made upon page load) like so:
This ID would be sent to the frontend or perhaps stored in the Flask session. We would then include it in any subsequent OpenSearch API requests, making it pretend as though we were searching in the past:
This will probably need some changes on the invenio-records-resources level to allow adding the PIT ID to requests.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status