不気味な追跡イベント 👻

以下のような事象が数ヶ月間確認できていましたが、一貫して再現できなかったため、これまで報告してきませんでした。しかし、ついに偶然にもその様子を動画に収めることに成功しました!(そのため、カーソルの動きに止まったり混乱したりしている部分があることをご了承ください。)

確認すべきポイントは以下の通りです:

  1. 未読が空欄になる
  2. Contribute > Feature が「通常」として表示される(設定で追跡対象になっているにもかかわらず)、ページを更新すると「追跡中」として表示される
  3. 突然、未読リストにトピックが現れる(数日前の、howto カテゴリからのもの)

2つ目の点は、私がよく目にするバグと少し似ています(ただし、動画で再現したことはありません)。これは、追跡中のカテゴリで「新規」からトピックをクリックしても、そのトピックのステータスがページを更新するまで「追跡中」として表示されないというものです。(これが関連しているのかもしれません。)

この動画を録画する直前、Contribute > Bug を追跡設定にし、未読タブからそのトピックの一つをクリックして、そのバグを再現しようとしていました。しかし、再現できませんでした。その後、Contribute > Bug の追跡を解除すると、未読タブに2015年頃からの Contribute > Bug の閉じられたトピックが約20件表示されるようになりました。これは3つ目のポイントと同じバグのようです。

なぜこのようなことが起こるのか理解できません。 :ghost:

「いいね!」 2

What are the repro steps?

「いいね!」 1

There are two bugs here.

I can’t consistently reproduce the first, where the correct notification level is only shown after a refresh (of a category, or a topic). It’s been happening to me for months, but whenever I try to reproduce it, it doesn’t happen.

The second, which I think is a bit more minor, but still a nuisance can be reproduced (for a limited time only) like so:

  1. Clear /unread
  2. Track a category currently set to ‘Normal’
  3. Go back to /unread and observe posts not previously in it

I’ve been able to do this with a number of categories, but only once for each. Once I’ve dismissed the posts from unread, they never appear again.

Consistently reproducing it takes a little more work, so hold onto your hats, it’s gonna get a bit crazy:

  • Go to unread in a category of your choosing which has a notification level of “Normal”, observe nothing there:

  • List all the currently tracked topics in that category (and remember, or take a screenshot of them):

  • Enter a topic from that category not on that list:

  • Start tracking the category
  • Again list tracked topics in that category
  • Observe the topic you just opened in that list:

  • Go to unread, and again observe that topic in the list:


TL;DR

So, the bug here is that previously opened topics in a category become tracked, and appear in unread (unless previously dismissed), when the category is tracked, whereas nothing happens to old not-opened-before topics.

To me, what should happen is either:

  • Nothing changes about the notification status of old topics in a category when it becomes tracked, previously opened or not.

or

  • All old topics become tracked when the category is tracked, but are automatically dismissed, so only new activity appears in the unread tab.

I lean towards the second solution, provided explicitly set notification levels on topics are kept.

I haven’t investigated how this works with other notification levels, I imagine its the same, but I feel it would confuse things for the time being.

So in relation to

What part is considered as “not working as expected”?

「いいね!」 1

2つの部分があります。

1つ目は、トピックが適切に暗黙的に追跡されていないことです。もしそうであれば、Community Building > Praise からのすべてのトピックが次のステップに表示されるはずです:

どうやらそのリストは「追跡済み」という追跡記録を持つトピックのみを表示しているようで、これが期待通りに動作していません。本来あるべき姿は、「追跡済み」という追跡記録を持つすべてのトピックと、追跡対象のカテゴリーに含まれるすべてのトピックを表示することです。(ウォッチについても同様です。)

さらに、これは理にかなっているようですが:

ユーザーがカテゴリーを追跡する場合にも、同じ機能が欠如しているようです。新しい投稿があるトピックにおいて、追跡記録も作成されないのでしょうか?

2つ目は、カテゴリーを追跡した際に、未読として表示される一見すると恣意的なトピックの表示です(これは、過去の記事の追跡状態を通常から追跡済みへ変更した副作用であると思われます)。これらは、それらのトピックを未読リストから自動的に非表示にすることで修正できるはずです。

What are your Preferences → Other
Consider topics new when
and
Automatically track topics I enter
settings?

I haven’t viewed them yet

never

「いいね!」 1

これは以前に見つけた問題で、関連するスレッドはこちらにあります(なぜ #contribute:bug から #contribute:feature に移動されたのかはよく分かりませんが)。

スレッドの内容は少し分かりにくいのですが、当初は phpBB からの初期インポートが原因だと思っていました。そこで、要点をまとめ直してみます:

要するに、トピックは同時に new(新規)と unread(未読)の両方になることはできません:

  • 暗黙的に追跡対象にはなっていますが、ユーザーが一度も閲覧したことがないため、unread には表示されません
  • 設定の「新規とみなす期間」のしきい値を超えているため、new にも表示されません

カテゴリ内のすべての古いトピックが「未読」タブに表示されるのは、ユーザー体験としてあまり良くないため、この問題を解決するのは難しいです。

それらを「自動的に既読として処理する」のは、データベース的にはコストがかかります(追跡対象にしたカテゴリ内のすべてのトピックに対して、新しい TopicUser レコードを作成する必要があるためです)。

私たちはこの問題を解決するためのすっきりとしたアイデアには至らず、議論は一旦終了しました。@sam が提案したオプションの一つは、

当時、私はこれが良いアイデアかもしれないと思いました:

しかし、

要約:私には解決策がありませんが、これで問題点が明確になれば幸いです :wink:

「いいね!」 3

And for the other issue in this thread:

I can reproduce this consistently here on meta for categories. Repro steps:

  1. Go to your user preferences, remove all tracked categories
  2. Go to a category page, e.g. #meta, and observe that the ‘notification level’ indicator is “normal”
  3. Go immediately to your user preferences, by clicking your avatar in the top right, then the cog
  4. Add the category you just visited, e.g. #meta, to your “tracking” categories
  5. Press “save changes”
  6. Press the back button in your browser to return to #meta, and observe that the ‘notification level’ indicator is still “normal”
  7. Refresh the page, and observe that the ‘notification level’ is now “tracked”

If you replace step 6 with visiting the category page by some other route, the tracking status appears correctly.

「いいね!」 5

From a practical perspective, that doesn’t make sense to me. If I buy a book and put it on my shelf having not opened it, it is both new and unread.

Wouldn’t it be possible to have an old topic (with no tracking record) only appear in unread when there’s new activity on it?

So, just as a tracking record is created on new activity for topics in watched categories, a tracking record would be created on new activity for topics in tracked categories.

Combined with the above, couldn’t we just dismiss topics where the tracking record has been changed to “tracking” as a result of tracking the category, which would mean the same user experience, without any additional database writes? (If I understand how tracking records, dismissing and TopicUser relate.)

This way, it seems to me, we could have a mailing list experience for tracking too! :smile:

Sure, I agree. I was talking purely about how it currently works in discourse.

I believe @sam thought this would have major performance issues

I’m 99% sure a new record isn’t created for tracked topics - @sam said “created when we notify users”, and tracking doesn’t cause notifications. Maybe fixing this is the solution :slight_smile:

「いいね!」 1

Do you know if there’s an architectural issue which means the new/unread either/or has to be the case?

Indeed, I was proposing this as a solution which seems to not have any major performance issues.

「いいね!」 1

I assume it’s by design - having a topic listed on the new tab and the unread tab would be a bit weird.

Taking your book analogy, while it can be both unread and new, you can’t put it on your “new” shelf and your “unread” shelf simultaneously :wink:

「いいね!」 4

Ok… I’ve done some testing in my dev environment. As a simplest possible repro:

  1. Set previous visit timeout hours site setting to 0, to make testing quicker
  • User A sets “Consider topics new when” to “created since I was last here”
  • User A sets Category1 to tracked
  • User B posts in Category1
  • User A observes the topic in ‘new’, but does not open it
  • User A leaves the site
  • User A comes back to the site later, and User B’s post is gone from the ‘new’ tab
  • User B posts again in the same topic
  • The topic does not appear in either ‘new’ or ‘unread’ for User A, even though they are tracking the topic

That same repro works for ‘watching’ a category as well. A notification is sent, but no TopicUser row is created (checked on the rails console). It seems that this:

is not happening for some reason, both for watched and tracked categories.

「いいね!」 1

Would it though? We already have topics listed in the latest tab and the new/unread tabs simultaneously. And the two (new and unread) are for different purposes: new is “show me the newest topics on this site” and unread is “show me topics I’ve expressed an interest in, but haven’t (finished) read(ing)”. For new to achieve its purpose it has to have unread topics in it which are new, and for unread to achieve its purpose it needs to have new topics in it which are unread.

Currently the unread tab is rather dysfunctional.

Interesting, thanks for doing all this investigation! So it would seem like if this did actually happen (or more specifically, a TopicUser row was created on topic update, rather than notification, to include tracked categories), then our problems here would be solved. @sam thoughts?

I am fine to change the semantics of “tracked category” so it means, if a category is tracked it will unconditionally show up in new regardless of your new duration, it does not mean this now.

「いいね!」 4