mirror of
https://github.com/Yonle/bostr.git
synced 2025-03-19 14:21:54 +01:00
bouncer: paused subs: even without filter.since, Pass any events that are new since the REQ command was taken
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
parent
114125242a
commit
3572a4b54b
@ -132,6 +132,7 @@ module.exports = (ws, req, onClose) => {
|
||||
ws.pause_subs.delete(origID);
|
||||
ws.subalias.set(faked, origID);
|
||||
ws.fakesubalias.set(origID, faked);
|
||||
if (!filter.since) filter.since = Math.floor(Date.now() / 1000); // Will not impact everything. Only used for handling passing pause_on_limit (or save mode)
|
||||
ws.mergedFilters.set(origID, filter);
|
||||
data[1] = faked;
|
||||
bc(data, ws);
|
||||
@ -245,7 +246,7 @@ function newConn(addr, client, reconn_t = 0) {
|
||||
if (!client.subalias.has(data[1])) return;
|
||||
data[1] = client.subalias.get(data[1]);
|
||||
const filter = client.mergedFilters.get(data[1]);
|
||||
if (client.pause_subs.has(data[1]) && (!filter.since || filter.since < data[2].created_at)) return;
|
||||
if (client.pause_subs.has(data[1]) && (filter.since < data[2].created_at)) return;
|
||||
|
||||
if (client.rejectKinds && client.rejectKinds.includes(data[2]?.id)) return;
|
||||
|
||||
|
@ -47,6 +47,7 @@ module.exports = {
|
||||
|
||||
// Pause an subscription from receiving further events after reached to <filter.limit>
|
||||
// Could save client's bandwidth. Disable this if you need to get more events.
|
||||
// This is also known as save mode.
|
||||
//
|
||||
// You may also need to adjust <max_eose_score>.
|
||||
pause_on_limit: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user