Fix state lifecycle management with post-feed query, solving the duplicate key issue (#2034)
* Assign keys to feed slices via a counter, to enable duplicate items in the feed if needed * Move post-feed query state into the query's page params to consistently bind their lifecycles
This commit is contained in:
parent
a59d235e8b
commit
630637874d
4 changed files with 99 additions and 91 deletions
|
@ -180,7 +180,7 @@ class MergeFeedSource {
|
|||
}
|
||||
|
||||
class MergeFeedSource_Following extends MergeFeedSource {
|
||||
tuner = new FeedTuner()
|
||||
tuner = new FeedTuner(this.feedTuners)
|
||||
|
||||
reset() {
|
||||
super.reset()
|
||||
|
@ -197,7 +197,7 @@ class MergeFeedSource_Following extends MergeFeedSource {
|
|||
): Promise<AppBskyFeedGetTimeline.Response> {
|
||||
const res = await getAgent().getTimeline({cursor, limit})
|
||||
// run the tuner pre-emptively to ensure better mixing
|
||||
const slices = this.tuner.tune(res.data.feed, this.feedTuners, {
|
||||
const slices = this.tuner.tune(res.data.feed, {
|
||||
dryRun: false,
|
||||
maintainOrder: true,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue