Skip to content

Pinned posts showing at the end of feeds

Marcelo Rivera requested to merge fix/pinned-posts-in-feeds-2461 into master

Summary

Prevent feed looping with pinned posts when reaching the last page.

Closes front#2461 (closed)

What happened

We were always adding pinned posts with timestamp set as 0: https://gitlab.com/minds/engine/-/blob/master/Core/Feeds/Elastic/Repository.php#L459-471

If it was the last page, it'd return just the three injected pinned posts, and these following lines would make it so the loadNext token would become 'inf': https://gitlab.com/minds/engine/-/blob/master/Core/Feeds/Elastic/Manager.php#L165-167

The solution consists in only adding those pinned posts like that to the first page

Merge request reports