Title: Bug: Pagination breaks if the row used as cursor is deleted · Issue #1357 · coder/coder · GitHub
Open Graph Title: Bug: Pagination breaks if the row used as cursor is deleted · Issue #1357 · coder/coder
X Title: Bug: Pagination breaks if the row used as cursor is deleted · Issue #1357 · coder/coder
Description: This issue was pointed out by @spikecurtis in #1308 (comment). Steps to Reproduce Set up coder server Request a user or template version with the after_id: GET 'http://localhost:3000/api/v2/templates/b60ecd72-9b8a-492b-b30d-077cbee5e550/...
Open Graph Description: This issue was pointed out by @spikecurtis in #1308 (comment). Steps to Reproduce Set up coder server Request a user or template version with the after_id: GET 'http://localhost:3000/api/v2/templat...
X Description: This issue was pointed out by @spikecurtis in #1308 (comment). Steps to Reproduce Set up coder server Request a user or template version with the after_id: GET 'http://localhost:3000/api/v2/tem...
Opengraph URL: https://github.com/coder/coder/issues/1357
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug: Pagination breaks if the row used as cursor is deleted","articleBody":"This issue was pointed out by @spikecurtis in https://github.com/coder/coder/pull/1308#discussion_r866142137.\r\n\r\n## Steps to Reproduce\r\n\r\n1. Set up coder server\r\n2. 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'`\r\n3. Delete the template version row in the database where `id = '49993e4e-a42f-40f3-96a8-636ac765833c'`\r\n4. Redo step 2\r\n\r\n## Expected\r\n\r\nThe API would return an error, all results or metadata related to pagination.\r\n\r\n## Actual\r\n\r\nThe API returns no results.\r\n\r\n## Notes\r\n\r\nWe'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.\r\n\r\nKeep solution as simple as possible. Throw an error if you get into a situation like this. ","author":{"url":"https://github.com/mafredri","@type":"Person","name":"mafredri"},"datePublished":"2022-05-10T08:01:59Z","url":"https://github.com/coder/coder/issues/1357"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4f4147bb-2f9b-f939-ee44-8c1f8f79c036 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF04:172B92:1F0A11B:2955C84:6B0176BE |
| html-safe-nonce | bb4a177fc1c75d7d4742a26cba9e0523cd9ff58c795c810a0871801bce11e015 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjA0OjE3MkI5MjoxRjBBMTFCOjI5NTVDODQ6NkIwMTc2QkUiLCJ2aXNpdG9yX2lkIjoiNDE4MTY4NzcxNTc1MTg4NDQ3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5d1b7c7d2b9eacd9d5145235b1af1c565292d600568098642038880e61a333ca |
| hovercard-subject-tag | issue:1230772109 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/1357/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9ebf75e360963618d778f1ea689bd0dc512c407714f68cd8557ac9a28ff15337/coder/coder/issues/1357 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9ebf75e360963618d778f1ea689bd0dc512c407714f68cd8557ac9a28ff15337/coder/coder/issues/1357 |
| og:image:alt | This issue was pointed out by @spikecurtis in #1308 (comment). Steps to Reproduce Set up coder server Request a user or template version with the after_id: GET 'http://localhost:3000/api/v2/templat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mafredri |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width