profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/animir/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

animir/node-rate-limiter-flexible 1813

Node.js rate limit requests by key with atomic increments in single process or distributed environment.

animir/nodebestpractices 3

The largest Node.JS best practices list (November 2018)

animir/awesome-nodejs 1

:zap: Delightful Node.js packages and resources

animir/alltables 0

parse tables for alltables.info

animir/angular-clock 0

angular clock widget directive: Demo-

animir/awesome-nodejs-security 0

Awesome Node.js Security resources

animir/bull 0

Premium Queue package for handling distributed jobs and messages in NodeJS.

animir/choise 0

Generate functions

animir/codility-go 0

Solutions for the codility.com exercises in Go

animir/connect-ensure-login 0

Login session ensuring middleware for Connect and Express.

issue commentanimir/node-rate-limiter-flexible

MongoDB (mongodb package version 4.0.x and 4.1.0): Showing error on 1st time wrong password attempt

@imranbarbhuiya It is not your code, but this package's code. Normally, findOne or any other find function shouldn't return undefined from MongoDB. In case of this error, it returns undefined and that's the issue. If you want to fix it, you should fix rate-limiter-flexible, so it correctly handles unexpected undefined, but works the same way as it would be null.

imranbarbhuiya

comment created time in 4 days

issue commentanimir/node-rate-limiter-flexible

Showing error on 1st time wrong password attempt

it is fixed in mongodb v4.1.1, it returns null and everything works fine. For mongoose users: update to the latest 6.x version, which already uses mongodb v4.1.1

imranbarbhuiya

comment created time in 6 days

issue commentanimir/node-rate-limiter-flexible

Showing error on 1st time wrong password attempt

@imranbarbhuiya I did some research and found out, that mongodb package findOne returns undefined when no doc found now. I can't tell which versions are affected, most likely 4.x. Here is the issue on MongoDB JIRA for context.

The fix is quite simple, this line https://github.com/animir/node-rate-limiter-flexible/blob/9847947130acdef16642579694e9b0f5fe41f4c3/lib/RateLimiterStoreAbstract.js#L264 and the next should be fixed. Note, resolve should be called with null no matter what res value really is.

imranbarbhuiya

comment created time in 7 days

startedmongodb/node-mongodb-native

started time in 7 days

issue commentanimir/node-rate-limiter-flexible

Showing error on 1st time wrong password attempt

@imranbarbhuiya hi, what MongoDB version do you use and mongoose package version?

imranbarbhuiya

comment created time in 7 days

startedsocketio/socket.io-redis-emitter

started time in 12 days

startedaxios/axios

started time in 12 days

issue commentanimir/node-rate-limiter-flexible

Implement SQLite3 limiter class

Closing due to inactivity

allouis

comment created time in 13 days

issue closedanimir/node-rate-limiter-flexible

Implement SQLite3 limiter class

I've read the docs, and it seems you can pass through knex instances, but I didn't see if it supports SQLite3 - could you clarify please?

closed time in 13 days

allouis

issue closedanimir/node-rate-limiter-flexible

It would be great if RateLimiterQueue could use RateLImiterUnion

Doesn't look like it would be a massive change, as the main issue seems to be handling the reject on the consume of the Union limiter, and checking for the maximum msBeforeNext of the rejection sub-limiters.

Similarly it would be nice if the Queue limiter could expose msBeforeNext from the underlying limiter in the exception provided when removeTokens() calls fails (for all underlying limiters, not just Union - perhaps there is already an easy way of doing this that I've missed?).

Conversely, RateLimiterUnion being able to handle RateLimiterQueues as a child limiter would also be handy, I realise the api for the queue limiter isn't consume based, but perhaps not impossible to make it look like it was from the top level Union point of view, especially if the Queue was able to expose msBeforeNext.

Anyway, only had a quick look at the code, so there might be fundamental architecture reasons why neither of these ideas make sense, so close and ignore if that's the case. Figured if the Queue and Union were a bit more composable , it would add to the flexibility of an already extremely flexible system. Thanks for all the time you've spent on the project!

closed time in 13 days

rj33

issue commentanimir/node-rate-limiter-flexible

It would be great if RateLimiterQueue could use RateLImiterUnion

Closing due to inactivity

rj33

comment created time in 13 days

issue commentanimir/node-rate-limiter-flexible

TypeError: Cannot read property '0' of undefined

@juniorwmr Hi, thank you for reporting this. Have you fixed it?

pg documentation says it should be res.rows[0]. It must be something else. Could you share your code with limiter creation and its usage?

juniorwmr

comment created time in 17 days

fork animir/API-template

template for Voiceflow take-home project

fork in 22 days

issue commentanimir/node-rate-limiter-flexible

getTokensRemaining broken for RateLimiterPostgres after key expires

@jhurwitz Hi, thank you for reporting this bug

jhurwitz

comment created time in a month

issue closedanimir/node-rate-limiter-flexible

How to rate limit an endpoint for each unique path params

My endpoint is : /orders/{orderId}/verify. I want to apply a rate limiter for each unique order id so that /orders/123/verify should be different than /orders/234/verify in terms of rate limit count. One can visit the first one, let's say, only 10 times in a minute and for more requests, they should get a rate limit exceed error but they can also visit the second order id verify end point without a problem since they are requesting it with different orderIds. Is it possible to achieve that?

closed time in 2 months

hamitg

issue commentanimir/node-rate-limiter-flexible

Rate limiter not obeying the settings I place in opts object. Renders 429 every time.

@LGmatrix13 hi, what is full rejRes error message there?

LGmatrix13

comment created time in 2 months

startedaackerman/circular-dependency-plugin

started time in 2 months

issue commentanimir/node-rate-limiter-flexible

How to rate limit an endpoint for each unique path params

@hamitg yes, it is possible, you can limit by order id

hamitg

comment created time in 2 months

push eventanimir/node-rate-limiter-flexible

Roman Voloboev

commit sha fcb6da92a57a039b644d715e6a8fb1a51b24415e

2.2.4

view details

push time in 2 months

issue closedanimir/node-rate-limiter-flexible

undefined is not iterable on mongoDB backend

I'm encountering this error from time to time:

undefined` is not iterable (cannot read property Symbol(Symbol.iterator)) TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at RateLimiterMongo._getRateLimiterRes (C:\www\projects\uefa_app\node_modules\rate-limiter-flexible\lib\RateLimiterMongo.js:117:15)
    at RateLimiterMongo._afterConsume (C:\www\projects\uefa_app\node_modules\rate-limiter-flexible\lib\RateLimiterStoreAbstract.js:51:22)
    at C:\www\projects\uefa_app\node_modules\rate-limiter-flexible\lib\RateLimiterStoreAbstract.js:205:16
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

https://github.com/animir/node-rate-limiter-flexible/blob/184d1d883583c53a5aff47726bc10afb6de3e4e9/lib/RateLimiterMongo.js#L116

Originally the issue seems to come from Mongo driver 4 as they have removed the ops attribute, needed when using replaceOne

closed time in 2 months

vdiez

push eventanimir/node-rate-limiter-flexible

vdiez

commit sha 475b15d8aec4f2b8cb6570e17c4e6ebc059520bc

fixes on issue #121

view details

Roman

commit sha bd2731c5d8d5085ccfc3a123ffa617c2569e5fe7

Merge pull request #122 from vdiez/master #121 Mongo: use findOneAndUpdate instead of replaceOne

view details

push time in 2 months

pull request commentanimir/node-rate-limiter-flexible

fixes on issue #121

@vdiez Good catch, thank you. I tested it on MongoDB 3.2, it works fine.

vdiez

comment created time in 2 months

pull request commentanimir/node-rate-limiter-flexible

fixes on issue #121

@vdiez Are these changes compatible with previous MongoDB client versions?

vdiez

comment created time in 2 months

issue commentanimir/node-rate-limiter-flexible

undefined is not iterable on mongoDB backend

@vdiez Hi, thank you for reporting this.

What should be used instead of ops in MongoDB driver v4+ ?

vdiez

comment created time in 2 months

created taganimir/node-rate-limiter-flexible

tagv2.2.3

Node.js rate limit requests by key with atomic increments in single process or distributed environment.

created time in 2 months

release animir/node-rate-limiter-flexible

v2.2.3

released time in 2 months

push eventanimir/node-rate-limiter-flexible

Roman Voloboev

commit sha c563f1fe061d184b519b6ed7fcfd8349d92f25bd

remove func args trailing comma

view details

Roman Voloboev

commit sha 184d1d883583c53a5aff47726bc10afb6de3e4e9

2.2.3

view details

push time in 2 months

push eventanimir/node-rate-limiter-flexible

Roman Voloboev

commit sha 5df3115478afab20eb3cc22d875157c8d0467326

2.2.2

view details

Roman Voloboev

commit sha ce8d1afe227e48e065b0b2e1293f15d847c1e3be

Merge branch 'master' of github.com:animir/node-rate-limiter-flexible

view details

push time in 2 months

push eventanimir/node-rate-limiter-flexible

Thomas Jaggi

commit sha e9b2b69d726e053c74e43b78edca70437325c50f

Replace deprecated MongoDB option

view details

Thomas Jaggi

commit sha b99d664bd691013c0a9619e90b01e8533cc546c3

Set MongoDB upsert options based on driver version

view details

Thomas Jaggi

commit sha 11948b6685583cfadfb966bcc7ef7bf2e63dba12

Optimize MongoDB driver version detection

view details

Thomas Jaggi

commit sha c6ac0c8a320f7b6336a797a76d05eed69aeaf574

Update MongoDB delete method

view details

Thomas Jaggi

commit sha 111553c339afb3a636f8da1f5b0ad95a2ed7958f

Add tests with MongoDB client

view details

Thomas Jaggi

commit sha b0ac15f198e9243acfce9ddc496da48dd8b98e84

Move MongoDB driver detection

view details

Thomas Jaggi

commit sha f1ea0be1c0d7c1d70fddce1c51f1bfb3c05909b9

Mock MongoDB driver version test

view details

Thomas Jaggi

commit sha a8a969b770ad5c5db19c52c4906a819a4177131b

Remove MongoDB dev dependencies

view details

Roman

commit sha dd1ebed4dc52c895ba53a126d40341bfbdd04381

Merge pull request #116 from backflip/master Use correct upsert options depending on mongodb client version, also use deletedCount attribute

view details

push time in 2 months