mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
Increase watch history fetch limit and expand tests
This commit is contained in:
1 parent
061bda8aec
commit
8ff22e1e81
3 files changed
+151
-6
No files matched your search
+27
-1
@@ -3823,11 +3823,37 @@ class NostrClient {
|
||||
this.watchHistoryCache.delete(actor);
|
||||
}
|
||||
|
||||
let newestSnapshotChunkTarget = 0;
|
||||
let newestSnapshotIdentifierTarget = 0;
|
||||
if (latestIndexSnapshotMeta?.snapshotId) {
|
||||
const latestSnapshotMeta = indexSnapshots.get(
|
||||
latestIndexSnapshotMeta.snapshotId
|
||||
);
|
||||
if (latestSnapshotMeta) {
|
||||
const totalChunksForLatest = Number.isFinite(
|
||||
latestSnapshotMeta.totalChunks
|
||||
)
|
||||
? Math.max(0, Math.floor(latestSnapshotMeta.totalChunks))
|
||||
: 0;
|
||||
if (totalChunksForLatest > 0) {
|
||||
newestSnapshotChunkTarget = totalChunksForLatest + 1;
|
||||
}
|
||||
if (latestSnapshotMeta.chunkIdentifiers instanceof Set) {
|
||||
const identifierCount = latestSnapshotMeta.chunkIdentifiers.size;
|
||||
if (identifierCount > 0) {
|
||||
newestSnapshotIdentifierTarget = identifierCount + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const chunkFilters = [];
|
||||
const chunkFetchLimit = Math.max(
|
||||
fetchLimit,
|
||||
chunkIdentifiers.size ? chunkIdentifiers.size + 1 : 0,
|
||||
snapshotIds.size ? snapshotIds.size * 2 : 0
|
||||
snapshotIds.size ? snapshotIds.size * 2 : 0,
|
||||
newestSnapshotChunkTarget,
|
||||
newestSnapshotIdentifierTarget
|
||||
);
|
||||
|
||||
if (chunkIdentifiers.size) {
|
||||
|
||||
Reference in new issue
Block a user