Improvements to feed assembly to avoid possible state issues (#1318)
* Avoid potential dropped posts due to pruning when checking for latest * Add a sanity check to ensure dup react keys never occur (close #1315)
This commit is contained in:
parent
e2f0770b88
commit
5ee754e6f9
2 changed files with 18 additions and 4 deletions
|
@ -105,6 +105,7 @@ export class FeedTuner {
|
|||
tune(
|
||||
feed: FeedViewPost[],
|
||||
tunerFns: FeedTunerFn[] = [],
|
||||
{dryRun}: {dryRun: boolean} = {dryRun: false},
|
||||
): FeedViewPostsSlice[] {
|
||||
let slices: FeedViewPostsSlice[] = []
|
||||
|
||||
|
@ -156,9 +157,11 @@ export class FeedTuner {
|
|||
}
|
||||
}
|
||||
|
||||
for (const slice of slices) {
|
||||
for (const item of slice.items) {
|
||||
this.seenUris.add(item.post.uri)
|
||||
if (!dryRun) {
|
||||
for (const slice of slices) {
|
||||
for (const item of slice.items) {
|
||||
this.seenUris.add(item.post.uri)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue