You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Pagination breaks if the row used as cursor is deleted #1357
Request a user or template version with the after_id: GET 'http://localhost:3000/api/v2/templates/b60ecd72-9b8a-492b-b30d-077cbee5e550/versions?limit=1&after_id=49993e4e-a42f-40f3-96a8-636ac765833c'
Delete the template version row in the database where id = '49993e4e-a42f-40f3-96a8-636ac765833c'
Redo step 2
Expected
The API would return an error, all results or metadata related to pagination.
Actual
The API returns no results.
Notes
We're not actively using pagination yet, so this is not an immediate problem and it may not ever be a problem for the aforementioned endpoints, but it's one that we should account for. The solution could be to either never delete rows from the database (only mark as deleted) or to query the database to verify that the cursor exists, either as part of the pagination query or separately.
Keep solution as simple as possible. Throw an error if you get into a situation like this.
Activity
tjcran commentedon May 16, 2022
Marking as a Community MVP bug so that we can check again once the related endpoints are completed to see if the issue still persists.
Emyrk commentedon May 17, 2022
Behavior will be to hard error
Emyrk commentedon Jun 2, 2022
Completed here: #1947