For admins, "Educate" message still shows up after more than 2 posts


(Brentley Jones) #1

On my new instance I’m using the forumadmin account. I’ve posted a good bit more than 2 times, yet I constantly get this helpful, but now annoying, message:

Edit: On try.discourse.com it took 3 posts to make it disappear, but I don’t think it was counting my topic itself as post #1. Maybe that’s the issue? I’ve only replied a couple times. I know over on @Lee_Ars’s forum a user was seeing the same thing:
Observations ** - useful info - Bigdinosaur Discourse


(Lee_Ars) #2

I see the bug report youopened for the oneboxing. I wonder if I can onebox the correct post in a reply.

(after a few minutes of experimenting)

Woah, that is downright weird. The base URL for the topic in question is:

http://discourse.bigdinosaur.org/t/observations/37/

…and the posts, obviously, start at /37/1 and go up to 24 (the last post in the thread). However, attempting to onebox the URLs leads to funky behavior; /37/1 oneboxes the first thread:

But /37/2 does not onebox the second post. Instead, it repeats the first post.

3-6 also repeat the first post. 7 brings up the actual 2nd post:

…and then 8-10 display actual posts 3-5. After that, 11 displays post 6:

…and that’s it. Any number after 11, including 189327409182, displays post 6:

So, the question is, is this something squirrely going on with my forum, or is there an actual bug?

edit: see fixed now yayyyy :clap:


(Brentley Jones) #3

I’ve seen it when linking to posts here on meta as well, so I think it’s not just your forum.


(Brentley Jones) #4

Still happening on my own forum. The only thing I can think of is I haven’t replied twice in the same topic yet. Yet, when I just tried this on try, the third reply didn’t have the message. I wonder what’s wrong on my instance.

I’m willing to have someone take a look at my instance if it’s needed.


(Jeff Atwood) #5

It’s also specific to topics vs. replies. If you have only posted 1 topic, you will get it on topic #2, even if you have posted thousands of replies.

The text is different for topics vs replies as well.


(Brentley Jones) #6

Yeah, I have 10 hand made topics and 4 replies. I’m still getting the yellow box when I try to make a new reply.


(Jeff Atwood) #7

@Neil can you take a look at this and see if you can repro locally


(Neil Lalonde) #8

I couldn’t repro locally. I’ll try some more tomorrow.


(Brentley Jones) #9

If you still can’t reproduce tomorrow you can PM and I’ll give you the info for my local instance. Maybe my account and access to the DB will help.


(Neil Lalonde) #10

I was able to reproduce. With a new user, I did this:

  • Create two new topics: got educated both times.
  • Create a third topic: no education.
  • Create a reply on someone else’s topic: got educated again.

Maybe that’s on purpose? I’ll look into it. Yes, it’s on purpose. Nevermind.


(Jeff Atwood) #11


(Brentley Jones) #12

Yeah, not what I’m talking about, sadly. I have multiple topics made and multiple replies. Every new reply I make I get the yellow dialog. On my user page it shows “16 Topics” and “14 Posts”.


(Jeff Atwood) #13

Can you reproduce it on http://try.discourse.org ? We can’t reproduce this. Would love to fix. Can’t fix until we can reproduce.


(Brentley Jones) #14

I can’t reproduce it there, tried. Is there something from the database that I should output here? I want to provide any info needed if I can. I don’t believe any of my users are seeing the same thing, just me on a renamed “forumadmin” account (renamed it to “Holly”).


(Jeff Atwood) #15

OK but then do we care? You’re making us do a lot of work for this thing that nobody can see except you. I’m just saying.


(Brentley Jones) #16

Sure, understandable. I thought I noticed that someone else (@nabiki over at @Lee_Ars’s forum) had the same issue. If no one else does though, then it can’t be a high priority. How do I forceable make it go away for myself, bug or not? Actually, I’ll just did into the code and see if I can find the root of the issue.


(Brentley Jones) #17

So, I think it might have to do with the fact that I renamed my user or changed my email. When inspecting this via the rails console I get the below:

me = User.find_by_username_or_email('XXX@gmail.com')
  User Load (1.0ms)  SELECT "users".* FROM "users" WHERE "users"."email" = 'XXX@gmail.com'
 => #<User id: 1, username: "Holly", created_at: "2013-07-05 00:00:00", updated_at: "2013-07-09 18:38:45", name: "Brentley Jones", bio_raw: "Co-Founder of Incendiary Legion", seen_notification_id: 38, last_posted_at: "2013-07-09 18:38:45", active: true, username_lower: "holly", last_seen_at: "2013-07-09 20:51:39", admin: true, last_emailed_at: "2013-07-09 18:56:39", email_digests: true, trust_level: 4, email_private_messages: true, email_direct: true, approved: false, approved_by_id: nil, approved_at: nil, topics_entered: 21, posts_read_count: 46, digest_after_days: 1, previous_visit_at: "2013-07-09 03:36:19", banned_at: nil, banned_till: nil, date_of_birth: nil, auto_track_topics_after_msecs: 0, views: 0, flag_level: 0, time_read: 6099, days_visited: 6, new_topic_duration_minutes: -1, external_links_in_new_tab: false, enable_quoting: true, moderator: false, likes_given: 1, likes_received: 1, topic_reply_count: 1, blocked: false, dynamic_favicon: false, title: "Co-Founder"> 

The key field is “topic_reply_count” which is only 1. That field gets translated into “Discourse.User.current(‘reply_count’)” which is checked for the education message. Somehow mine is stuck at 1?

Is there something wrong with this method?

def update_topic_reply_count
    self.topic_reply_count =
        Topic
        .where(['id in (
              SELECT topic_id FROM posts p
              JOIN topics t2 ON t2.id = p.topic_id
              WHERE p.deleted_at IS NULL AND
                t2.user_id <> p.user_id AND
                p.user_id = ?
              )', self.id])
        .count
  end

Regardless, to fix my own issue I just manually changing that field to 3. I did a new reply and it’s still 3, so clearly it’s not updating for me.


(Brentley Jones) #18

Checking today, it’s now 2 instead of 3. I think it might be calculating that number wrong. Anyway, I’m leaving this be until any of you need something else from me. Thanks for your time.


(Robin Ward) #19

One key difference is it doesn’t track replies to your own topics to avoid spam.

If you’ve mostly replied to yourself, the counter won’t go up. Is it possible that happened to you?


(Brentley Jones) #20

My own topics? Yes, but I made most of them, since almost no one else was making them. Shouldn’t it count replies to other people’s replies in my topic? Either way, I think it would be an edge case that will plague admins.