# 按投票排序时，某些主题会消失

**URL:** https://meta.discourse.org/t/some-topics-disappear-when-sorting-by-votes/213669
**Category:** Bug
**Tags:** topic-voting
**Created:** [2022年一月2日 23:35 UTC](https://meta.discourse.org/t/some-topics-disappear-when-sorting-by-votes/213669 "2022-01-02T23:35:21Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [2022年一月2日 23:35 UTC](https://meta.discourse.org/t/some-topics-disappear-when-sorting-by-votes/213669/1 "2022-01-02T23:35:21Z")

</div>

使用投票插件，我刚刚发现一个包含 61 个主题的类别在按投票数排序时只显示 59 个。不用说，主题消失是一个糟糕的错误，因为这样就更难找到它们，也就更难投票。有这么多条目，我是在尝试在表格中间找到“我的”主题时才意识到这一点的。 😏

目前，匿名用户可以重现此问题。我也可以在登录时看到它，即使在那里消失的主题不同。（？）

按最新排序的完整列表：[Community Wishlist - Bitwish](https://bitwish.top/c/features/5/l/latest)

按投票数排序时缺少 2 个项目的列表：[Community Wishlist - Bitwish](https://bitwish.top/c/features/5/l/latest?order=votes)

目前，“最新”中有 5 个主题有 6 票，而“投票数”中只有 3 个主题。丢失的主题：

- [Text annotations - Implemented - Bitwish](https://bitwish.top/t/text-annotations/314)
- [Stepper/Performer modulator - Implemented - Bitwish](https://bitwish.top/t/stepper-performer-modulator/149)

登录时，丢失的主题是：

- [Text annotations - Implemented - Bitwish](https://bitwish.top/t/text-annotations/314)
- [Asynchronous collaboration - Community Wishlist - Bitwish](https://bitwish.top/t/asynchronous-collaboration/47)

我不知道为什么会发生这种情况，也不知道如果创建新主题或更改投票数是否会发生变化。如有需要，我可以提供更多信息。

（有人可以添加 #voting 标签吗？）

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [2022年一月3日 16:31 UTC](https://meta.discourse.org/t/some-topics-disappear-when-sorting-by-votes/213669/2 "2022-01-03T16:31:39Z")

</div>

经过一些测试，原因可能是……

[Community Wishlist - Bitwish](https://bitwish.top/c/features/5/l/latest?order=votes) 是一个很长的页面。在桌面或移动浏览器上加载它时，如果用户停留在顶部，则只会加载该页面的一半。其余部分仅在向下滚动后加载。“断点”正好在“6 票”区域。

这让我想到了用另一个浏览器进行测试。第一个报告是在 Firefox 桌面和移动设备上测试的。结果发现 Chrome 桌面上的行为非常相似，但又不完全相同。在我的测试中，Chrome 显示了 60 个结果（而不是 61 个，也不同于 Firefox 的 59 个）。确实，使用 Chrome 桌面渲染页面时，有 6 票的 5 个主题中有 4 个被列出。虽然有所改善，但仍然不理想。

不知何故，当页面按得票数排序时，主题在用户向下滚动加载其余页面时似乎会丢失。

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2022年一月4日 07:17 UTC](https://meta.discourse.org/t/some-topics-disappear-when-sorting-by-votes/213669/3 "2022-01-04T07:17:42Z")

</div>

> [@icaria36](#):
>
> 出于某种原因，当页面按“投票”排序时，用户向下滚动加载页面其余部分时，主题似乎会丢失。

这是一个令人担忧的问题……听起来像是某个地方出现了一个“越界错误”。

@vinothkannans 你能调查一下吗？

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [2022年三月3日 20:18 UTC](https://meta.discourse.org/t/some-topics-disappear-when-sorting-by-votes/213669/5 "2022-03-03T20:18:59Z")

</div>

> [@icaria36](#):
>
> 按“投票数”排序时，一个包含 61 个主题的类别仅显示 59 个。

此问题已在以下 PR 中修复：

> <https://github.com/discourse/discourse-topic-voting/pull/109>
>
> If the number of votes is the same and the second order-by column is not specifi…ed then Postgres makes no guarantee about what the ordering will be.
> 
> https://meta.discourse.org/t/some-topics-disappear-when-sorting-by-votes/213669

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [2022年三月5日 19:15 UTC](https://meta.discourse.org/t/some-topics-disappear-when-sorting-by-votes/213669/6 "2022-03-05T19:15:28Z")

</div>

非常感谢您，@vinothkannans。今天我们已升级并能正常工作。

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2022年三月8日 00:48 UTC](https://meta.discourse.org/t/some-topics-disappear-when-sorting-by-votes/213669/7 "2022-03-08T00:48:57Z")

</div>


