Title: Incrementing a value into the negative does not work · Issue #65 · github/github-ds · GitHub
Open Graph Title: Incrementing a value into the negative does not work · Issue #65 · github/github-ds
X Title: Incrementing a value into the negative does not work · Issue #65 · github/github-ds
Description: When using the increment method, if you increment the value below 0, the output is unexpected and subsequent increments fail. > GitHub.kv.get(kv_key).value! { 0 } nil > GitHub.kv.increment(kv_key) 1 > GitHub.kv.get(kv_key).value! { 0 } "...
Open Graph Description: When using the increment method, if you increment the value below 0, the output is unexpected and subsequent increments fail. > GitHub.kv.get(kv_key).value! { 0 } nil > GitHub.kv.increment(kv_key) ...
X Description: When using the increment method, if you increment the value below 0, the output is unexpected and subsequent increments fail. > GitHub.kv.get(kv_key).value! { 0 } nil > GitHub.kv.increment(kv...
Opengraph URL: https://github.com/github/github-ds/issues/65
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incrementing a value into the negative does not work","articleBody":"When using the [`increment`](https://github.com/github/github-ds/blob/f964ab2d75272d5b5d2fef68416abcab7bd2dc3a/lib/github/kv.rb#L287) method, if you increment the value below 0, the output is unexpected and subsequent `increment`s fail.\n\n```ruby\n\u003e GitHub.kv.get(kv_key).value! { 0 }\nnil\n\n\u003e GitHub.kv.increment(kv_key)\n1\n\n\u003e GitHub.kv.get(kv_key).value! { 0 }\n\"1\"\n\n\u003e GitHub.kv.increment(kv_key, amount: -2)\n18446744073709551615\n\n\u003e GitHub.kv.get(kv_key).value! { 0 }\n\"18446744073709551615\"\n\n\u003e GitHub.kv.increment(kv_key, amount: 2)\neval error: GitHub::KV::InvalidValueError\n vendor/gems/3.2.2/ruby/3.2.0/gems/github-ds-0.5.2.10.g8cf56ba:in `block in increment'\n```","author":{"url":"https://github.com/scotttesler","@type":"Person","name":"scotttesler"},"datePublished":"2023-08-24T21:22:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/65/github-ds/issues/65"}
| 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:2f0f335c-22b0-d7b7-ca14-380b054bbab3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DEC6:12CE77:EFC14F:13AD7D8:698EC897 |
| html-safe-nonce | bd27e477695df84e6b9be4899eabc8b94c2bcacd6f9693e934dda66bbd1c603e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERUM2OjEyQ0U3NzpFRkMxNEY6MTNBRDdEODo2OThFQzg5NyIsInZpc2l0b3JfaWQiOiIzNTM4OTU2MzI2NzE2NDkxOTI3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | bcdc185a4fd10d3d7e1e9835c93319a175993d270bca8a8037f46b19044866c6 |
| hovercard-subject-tag | issue:1865906420 |
| 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/github/github-ds/65/issue_layout |
| twitter:image | https://opengraph.githubassets.com/111dc031b2ebeaa328166a213b7c40352077c104b1f98a088dc85a0ec19e22dd/github/github-ds/issues/65 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/111dc031b2ebeaa328166a213b7c40352077c104b1f98a088dc85a0ec19e22dd/github/github-ds/issues/65 |
| og:image:alt | When using the increment method, if you increment the value below 0, the output is unexpected and subsequent increments fail. > GitHub.kv.get(kv_key).value! { 0 } nil > GitHub.kv.increment(kv_key) ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | scotttesler |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb2828a801ee6b7be618f3ac76fbf55def35bbc30f053a9c41bf90210b8b72ba |
| turbo-cache-control | no-preview |
| go-import | github.com/github/github-ds git https://github.com/github/github-ds.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 75887039 |
| octolytics-dimension-repository_nwo | github/github-ds |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 75887039 |
| octolytics-dimension-repository_network_root_nwo | github/github-ds |
| 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 | e6b91a7e6e46287d26887e3fb7a4161657bab8f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width