# Отслеживание темы с помощью сочетания клавиш также отслеживает другие темы

**URL:** https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790
**Category:** Bug
**Tags:** keyboard-shortcuts
**Created:** [10.Март.2020 10:48:22 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790 "2020-03-10T10:48:22Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![mpol](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpol/32/212034_2.png) [@mpol](https://meta.discourse.org/u/mpol)
#### Post date: [10.Март.2020 10:48:22 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/1 "2020-03-10T10:48:22Z")

</div>

Когда я использую сочетания клавиш `m t` и `m r` для отслеживания/снятия отслеживания темы, это также меняет статус отслеживания других тем, которые я недавно просматривал в том же окне.

Это, кажется, не происходит при использовании мыши.

Наблюдалось в Firefox 68.4.1esr. Впервые замечено на Rust Discourse, теперь я также проверил это здесь.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [10.Март.2020 14:51:33 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/3 "2020-03-10T14:51:33Z")

</div>

Привет, спасибо за сообщение!

Думаю, эта ошибка существовала уже довольно давно, возможно, недавние изменения сделали её более заметной.

Коротко о главном:

- при получении события изменения мы не проверяем идентификатор темы
- мы не ограничиваем частоту срабатывания горячих клавиш, поэтому, если зажать клавишу «m», событие будет отправляться бесконечно…

Вот исправление:

> <https://github.com/discourse/discourse/pull/9159>

Это должно быть слито до конца недели.

---

<div class="post-metadata">

### Author: ![mpol](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpol/32/212034_2.png) [@mpol](https://meta.discourse.org/u/mpol)
#### Post date: [13.Март.2020 11:01:54 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/4 "2020-03-13T11:01:54Z")

</div>

Здравствуйте,  
Сколько времени обычно занимает развёртывание исправления после слияния pull request?  
На данный момент я не наблюдаю никаких изменений в поведении.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [13.Март.2020 11:05:54 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/5 "2020-03-13T11:05:54Z")

</div>

Зависит от того, о каком форуме идёт речь. Коммит уже принят в мастер-ветку и перенесён в стабильную ветку, поэтому каждый должен иметь возможность его получить.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [15.Март.2020 01:00:07 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/6 "2020-03-15T01:00:07Z")

</div>

Эта тема была автоматически закрыта через 3 дня. Новые ответы больше не принимаются.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [03.Апрель.2020 18:42:18 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/7 "2020-04-03T18:42:18Z")

</div>



---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [06.Апрель.2020 09:34:05 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/8 "2020-04-06T09:34:05Z")

</div>

@Falco, это регресс?

---

<div class="post-metadata">

### Author: ![mpol](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpol/32/212034_2.png) [@mpol](https://meta.discourse.org/u/mpol)
#### Post date: [06.Апрель.2020 10:10:25 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/9 "2020-04-06T10:10:25Z")

</div>

Привет @david  
Я всё ещё могу воспроизвести эту проблему на этом форуме. Не знаю, была ли она невозможна для воспроизведения в промежутке.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [06.Апрель.2020 10:13:39 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/10 "2020-04-06T10:13:39Z")

</div>

@joffreyjaffeux, не могли бы вы ещё раз посмотреть, пожалуйста?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [06.Апрель.2020 11:07:03 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/12 "2020-04-06T11:07:03Z")

</div>

@mpol нам не удалось воспроизвести эту проблему. Не могли бы вы подробно описать шаги, которые вы выполняете для её воспроизведения здесь, на Meta?

---

<div class="post-metadata">

### Author: ![mpol](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpol/32/212034_2.png) [@mpol](https://meta.discourse.org/u/mpol)
#### Post date: [06.Апрель.2020 11:58:50 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/13 "2020-04-06T11:58:50Z")

</div>

Извините, если проблема оказывается на моей стороне, но вот что происходит в Firefox 68.6.0esr прямо сейчас.

1. Используя только навигацию с клавиатуры, начиная с только что открытой главной страницы [https://meta.discourse.org/](https://meta.discourse.org/) в новой вкладке, у меня изначально нет отслеживаемых тем.
2. Я нажимаю ‘j’, затем ‘Enter’, чтобы открыть тему.
3. Я нажимаю ‘j’ достаточное количество раз, чтобы перейти к предложенным темам, и нажимаю ‘Enter’, чтобы открыть одну из них.
4. Я нажимаю ‘j’, ‘m’, ‘t’ — теперь отслеживаются обе темы: и эта, и та, которую я открыл с главной страницы.

Кстати, я только что заметил, что если на шаге 3 нажать ‘m’, ‘t’ сразу, то отслеживается только правильная тема. Но даже после этого нажатие ‘j’, ‘m’, ‘t’ меняет состояние предыдущей темы.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [06.Апрель.2020 11:59:27 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/14 "2020-04-06T11:59:27Z")

</div>

Я не смог воспроизвести эту конкретную ошибку, и @david тоже, но у @david в браузере было много активных запросов, чего не было у меня. Сначала я подумал о браузере, а затем о нескольких открытых окнах браузера?

После некоторого поиска я понял, что проблема связана с размером окна браузера (у меня оно было узким, а у Дэвида — широким), и кнопкой временной шкалы темы, которая постоянно регистрировала новый обработчик `appEvents`. Эта кнопка отображалась у Дэвида, но не у меня.

Я думаю, что это должно значительно улучшить ситуацию с отслеживанием тем. Подробнее в коммите:

> <https://github.com/discourse/discourse/pull/9356>
>
> A large topic page will always have the bottom tracking button, and will also ha…ve the timeline, meaning we already had 2 tracking events.
> 
> But it gets even worse when you know that the timeline button is a component connector which will trigger \`didInsertElement\` very frequently, meaning we were constantly adding more and more appEvents handlers.

---

<div class="post-metadata">

### Author: ![mpol](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpol/32/212034_2.png) [@mpol](https://meta.discourse.org/u/mpol)
#### Post date: [06.Апрель.2020 12:17:20 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/15 "2020-04-06T12:17:20Z")

</div>

А, да, запросы. Итак, в конце описанная выше процедура сгенерировала два идентичных POST-запроса к `https://meta.discourse.org/t/146924/notifications`, а затем, полагаю, проблемный запрос к `https://meta.discourse.org/t/113192/notifications`.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [06.Апрель.2020 13:06:06 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/16 "2020-04-06T13:06:06Z")

</div>

Да, это должно исправить подобные проблемы. Я сейчас сливаю изменения, так что вы сможете проверить это в Meta уже скоро.

---

<div class="post-metadata">

### Author: ![mpol](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpol/32/212034_2.png) [@mpol](https://meta.discourse.org/u/mpol)
#### Post date: [06.Апрель.2020 13:56:47 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/17 "2020-04-06T13:56:47Z")

</div>

@joffreyjaffeux Спасибо. После нескольких попыток мне больше не удалось воспроизвести проблему здесь, и теперь я действительно вижу только один правильный запрос к `/notifications` — без дубликатов и без запросов для других тем.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [06.Апрель.2020 13:59:31 UTC](https://meta.discourse.org/t/tracking-a-topic-using-the-keyboard-shortcut-tracks-other-topics-too/143790/18 "2020-04-06T13:59:31Z")

</div>


