# \`in:messages\` 过滤器在标头中无法可靠地更新

**URL:** https://meta.discourse.org/t/in-messages-filter-doesnt-update-reliably-in-header/367837
**Category:** Bug
**Tags:** search
**Created:** [2025年五月27日 21:17 UTC](https://meta.discourse.org/t/in-messages-filter-doesnt-update-reliably-in-header/367837 "2025-05-27T21:17:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2025年五月27日 21:17 UTC](https://meta.discourse.org/t/in-messages-filter-doesnt-update-reliably-in-header/367837/1 "2025-05-27T21:17:20Z")

</div>

标题中的 `in:messages` 过滤器似乎有点错误：

访问收件箱时它不会显示，需要先刷新。但之后，当你访问另一页面时它不会消失，直到你再次重新加载。

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [2025年五月29日 02:13 UTC](https://meta.discourse.org/t/in-messages-filter-doesnt-update-reliably-in-header/367837/2 "2025-05-29T02:13:08Z")

</div>

感谢你的报告。我已经将此话题移至 #Contribute > Bug 频道，稍后将有人查看。

---

<div class="post-metadata">

### Author: ![renato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renato/32/383632_2.png) [@renato](https://meta.discourse.org/u/renato)
#### Post date: [2025年五月30日 18:04 UTC](https://meta.discourse.org/t/in-messages-filter-doesnt-update-reliably-in-header/367837/4 "2025-05-30T18:04:18Z")

</div>

这应该可以解决问题：

> <https://github.com/discourse/discourse/pull/33016>
>
> Uses a getter to reactively re-render the search context (eg. "in messages").
> 
> …
> Also fixes an issue where although the in:messages suggestion appeared, it didn't work to add the PM context.

---

<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: [2025年六月3日 03:57 UTC](https://meta.discourse.org/t/in-messages-filter-doesnt-update-reliably-in-header/367837/5 "2025-06-03T03:57:46Z")

</div>


