Fix policy bug
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import {on, nthEq, always, call, sleep, ago, now} from "@welshman/lib"
|
import {on, nthNe, always, call, sleep, ago, now} from "@welshman/lib"
|
||||||
import {AUTH_JOIN, StampedEvent, SignedEvent} from "@welshman/util"
|
import {AUTH_JOIN, StampedEvent, SignedEvent} from "@welshman/util"
|
||||||
import {
|
import {
|
||||||
ClientMessage,
|
ClientMessage,
|
||||||
@@ -42,7 +42,7 @@ export const socketPolicyAuthBuffer = (socket: Socket) => {
|
|||||||
// If the client is closing a req, remove both from our buffer
|
// If the client is closing a req, remove both from our buffer
|
||||||
// Otherwise, if auth isn't done, hang on to recent messages in case we need to replay them
|
// Otherwise, if auth isn't done, hang on to recent messages in case we need to replay them
|
||||||
if (isClientClose(message) || isClientNegClose(message)) {
|
if (isClientClose(message) || isClientNegClose(message)) {
|
||||||
buffer = buffer.filter(nthEq(1, message[1]))
|
buffer = buffer.filter(nthNe(1, message[1]))
|
||||||
} else {
|
} else {
|
||||||
buffer = buffer.slice(-50).concat([message])
|
buffer = buffer.slice(-50).concat([message])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user