{"action":"created","issue":{"url":"https://api.github.com/repos/scttcper/koa-simple-ratelimit/issues/34","repository_url":"https://api.github.com/repos/scttcper/koa-simple-ratelimit","labels_url":"https://api.github.com/repos/scttcper/koa-simple-ratelimit/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/scttcper/koa-simple-ratelimit/issues/34/comments","events_url":"https://api.github.com/repos/scttcper/koa-simple-ratelimit/issues/34/events","html_url":"https://github.com/scttcper/koa-simple-ratelimit/issues/34","id":186656451,"number":34,"title":"illogical pttl value leads to functional blacklisting","user":{"login":"weisjohn","id":12034,"avatar_url":"https://avatars.githubusercontent.com/u/12034?v=3","gravatar_id":"","url":"https://api.github.com/users/weisjohn","html_url":"https://github.com/weisjohn","followers_url":"https://api.github.com/users/weisjohn/followers","following_url":"https://api.github.com/users/weisjohn/following{/other_user}","gists_url":"https://api.github.com/users/weisjohn/gists{/gist_id}","starred_url":"https://api.github.com/users/weisjohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weisjohn/subscriptions","organizations_url":"https://api.github.com/users/weisjohn/orgs","repos_url":"https://api.github.com/users/weisjohn/repos","events_url":"https://api.github.com/users/weisjohn/events{/privacy}","received_events_url":"https://api.github.com/users/weisjohn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-01T21:45:04Z","updated_at":"2016-11-01T23:07:58Z","closed_at":null,"body":"I'm still trying to track down how this happened, but on my local redis (3.0.2) I see:\r\n\r\n```\r\n127.0.0.1:6379> get limit:::1:count\r\n\"-1\"\r\n127.0.0.1:6379> pttl limit:::1:count\r\n(integer) -1\r\n```\r\n\r\nAnd according to http://redis.io/commands/pttl,\r\n\r\n> \"The command returns -1 if the key exists but has no associated expire.\"\r\n\r\nShould we check for -1 as well as null in https://github.com/scttcper/koa-simple-ratelimit/blob/master/index.js#L79 ?\r\n\r\nAs it is now, it can never get unset and the user (me) is hosed."},"comment":{"url":"https://api.github.com/repos/scttcper/koa-simple-ratelimit/issues/comments/257726016","html_url":"https://github.com/scttcper/koa-simple-ratelimit/issues/34#issuecomment-257726016","issue_url":"https://api.github.com/repos/scttcper/koa-simple-ratelimit/issues/34","id":257726016,"user":{"login":"scttcper","id":1400464,"avatar_url":"https://avatars.githubusercontent.com/u/1400464?v=3","gravatar_id":"","url":"https://api.github.com/users/scttcper","html_url":"https://github.com/scttcper","followers_url":"https://api.github.com/users/scttcper/followers","following_url":"https://api.github.com/users/scttcper/following{/other_user}","gists_url":"https://api.github.com/users/scttcper/gists{/gist_id}","starred_url":"https://api.github.com/users/scttcper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scttcper/subscriptions","organizations_url":"https://api.github.com/users/scttcper/orgs","repos_url":"https://api.github.com/users/scttcper/repos","events_url":"https://api.github.com/users/scttcper/events{/privacy}","received_events_url":"https://api.github.com/users/scttcper/received_events","type":"User","site_admin":false},"created_at":"2016-11-01T23:07:58Z","updated_at":"2016-11-01T23:07:58Z","body":"@weisjohn @niftylettuce it looks like if you have multiple connections at once we could have a race condition the results in -1. What they're talking about in this pull request. https://github.com/tj/node-ratelimiter/pull/25 Maybe on the next request if the ttl is -1 we can delete the key."}}
{"actor":{"display_login":"scttcper"}}