mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Ensure sitemaps include all topics with no duplicates (#26289)
We were using `OFFSET`/`LIMIT` to query topics without an 'ORDER'. Without an explicit order, postgres makes no guarantees about which rows will be returned for each query. This commit adds `ORDER BY id ASC` so that our sitemaps behave consistently.
This commit is contained in:
parent
284b65e165
commit
4e082c7390
@ -62,7 +62,7 @@ class Sitemap < ActiveRecord::Base
|
|||||||
else
|
else
|
||||||
offset = (name.to_i - 1) * max_page_size
|
offset = (name.to_i - 1) * max_page_size
|
||||||
|
|
||||||
indexable_topics.limit(max_page_size).offset(offset)
|
indexable_topics.order(id: :asc).limit(max_page_size).offset(offset)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user