// Confusingly, the Mastodon protocol considers
// "next" to be heading into the past and "prev"
// the future.
- Some("next") => feed.extend_past = Some(link.queries),
- Some("prev") => feed.extend_future = Some(link.queries),
+ //
+ // We only keep the extension link for directions
+ // that are the current frontier. If we're
+ // extending an existing feed further into the
+ // past, then the future link we have already is
+ // better than the new one (which will cause us to
+ // re-fetch stuff we already had). And vice versa.
+ Some("next") => if ext != FeedExtend::Future {
+ feed.extend_past = Some(link.queries);
+ }
+ Some("prev") => if ext != FeedExtend::Past {
+ feed.extend_future = Some(link.queries);
+ }
_ => (),
}
}