nostr-idb 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/relay/relay-core.js
CHANGED
|
@@ -5,7 +5,8 @@ import { getEventsForFilters, countEventsForFilters, } from "../database/query-f
|
|
|
5
5
|
import { sortByDate } from "../utils.js";
|
|
6
6
|
import { nanoid } from "../lib/nanoid.js";
|
|
7
7
|
import { logger } from "../debug.js";
|
|
8
|
-
import { getEventUID
|
|
8
|
+
import { getEventUID } from "../database/ingest.js";
|
|
9
|
+
import { pruneLastUsed } from "../database/prune.js";
|
|
9
10
|
const defaultOptions = {
|
|
10
11
|
batchWrite: 1000,
|
|
11
12
|
writeInterval: 100,
|
|
@@ -125,7 +126,11 @@ export class RelayCore {
|
|
|
125
126
|
return sub;
|
|
126
127
|
}
|
|
127
128
|
unsubscribe(id) {
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
const sub = this.subscriptions.get(id);
|
|
130
|
+
if (sub) {
|
|
131
|
+
log(`Closing ${id}`);
|
|
132
|
+
sub.onclose?.("unsubscribe");
|
|
133
|
+
this.subscriptions.delete(id);
|
|
134
|
+
}
|
|
130
135
|
}
|
|
131
136
|
}
|
package/dist/worker/shared.js
CHANGED
|
@@ -7486,8 +7486,12 @@ class RelayCore {
|
|
|
7486
7486
|
return sub;
|
|
7487
7487
|
}
|
|
7488
7488
|
unsubscribe(id) {
|
|
7489
|
-
|
|
7490
|
-
|
|
7489
|
+
const sub = this.subscriptions.get(id);
|
|
7490
|
+
if (sub) {
|
|
7491
|
+
log$1(`Closing ${id}`);
|
|
7492
|
+
sub.onclose?.("unsubscribe");
|
|
7493
|
+
this.subscriptions.delete(id);
|
|
7494
|
+
}
|
|
7491
7495
|
}
|
|
7492
7496
|
}
|
|
7493
7497
|
|
package/dist/worker/worker.js
CHANGED
|
@@ -7486,8 +7486,12 @@ class RelayCore {
|
|
|
7486
7486
|
return sub;
|
|
7487
7487
|
}
|
|
7488
7488
|
unsubscribe(id) {
|
|
7489
|
-
|
|
7490
|
-
|
|
7489
|
+
const sub = this.subscriptions.get(id);
|
|
7490
|
+
if (sub) {
|
|
7491
|
+
log$1(`Closing ${id}`);
|
|
7492
|
+
sub.onclose?.("unsubscribe");
|
|
7493
|
+
this.subscriptions.delete(id);
|
|
7494
|
+
}
|
|
7491
7495
|
}
|
|
7492
7496
|
}
|
|
7493
7497
|
|