Reply then edit to add quote notification redundancy

I didn’t here, but maybe that’s because you replied to the topic and not another post. I did have this issue on another reply from you five days ago:


As well as from someone else earlier today:


Did you get two notifications from this reply? I think it happens every time (again barring the reply to topic).

1 Like

This is a direct reply not to the topic.

I totally believe it is happening, just want an exact repro.

I only got a reply notification… That’s weird. So I guess it doesn’t happen every time, though I see it quite often.

I don’t see any difference between your reply here and the ones that caused the issue before. They are both replies to the previous post (non-topic) with quotes from the same post. Here are links to the two I referenced above if you can spot a difference.

Beginners Guide to Install Discourse on Windows 10 for Development

`min ratio to crop` site setting should respect w/h ratio as defined in markdown

The only other thing I can think of is that the quote notifications seem to be delayed sometimes, generally coming after the reply notification. If those notifications come from a background task, maybe there’s some kind of race condition.


Yeah this very much feels like a race condition to me.


Doesn’t it happen when you first just reply, and then edit with a quote afterwards?


It does happen in those cases, but I doubt only in those cases. It happens often enough that it seems unlikely that that many people are adding quotes on edit. Perhaps @sam can confirm if he wrote the post I referenced at once or edited it after the fact with a quote. If he remembers since it was 6 days ago at this point.

I just got this as well for this reply/quote, screenshot:


In that case I did first reply, and then saved and then almost immediately edited to add the quote to give better context. So that would explain two notifications - once for the reply, and then for the quote when I edited it.


Ah, thanks, that would explain it then.

1 Like

I still wonder if there’s some kind of race condition where quotes made in the original reply (not on edit) can be treated like a quote added on edit. Just from the timing that is.

I only got one notification for this quote/reply. That doesn’t rule out the race condition entirely, but this is more likely the scenario Falco mentioned, i.e. replying then editing quickly to add a quote.


So we need to ask users not to do this :slight_smile:

It does seem to happen as an afterthought. You write a post quickly and submit it, but then you realize the context may not be entirely obvious and go back to add the quote.

Now that the “quote on edit” aspect has been mentioned I’ve been paying more attention, and I’ve been quoted several times without getting the quote notification. So it does appear likely related to that. Unfortunately I can’t really verify anything on my own since I’m not going to ask someone if they added the quote on edit every time I get the quote notification.

If it really does only happen on edit (and never from a race condition), it’s actually kind of a nice “feature” because it lets you know that more was added to a post even if you already read it.


This does happen to me way too much recently … I just got a triple from @downey.

@kris.kotlarek can you investigate this? At least confirm that this is not possible in a non race condition kind of case (reply directly, then edit to add a quote)

As a general rule we should never notify that something has a “mention” if it is already a direct reply.

Protecting against timing is going to be tricky, we are going to need a distributed mutex on the user/post pair, lets hold a bit before we add that.


This is my potential solution. The idea is to not create a notification, if the user already has unread new reply notification.

If new reply notification was read, then we still want to have a notification that post was edited and for example, the quote was added because that additional information may be valuable to the recipient.


I am not sure … I think this is overthinking the problem a bit.

If I directly respond to :arrow_double_up: right now… then tomorrow come back to this post after you read it and add the word “casino” you will not get a notification.

I edited the post, it was a direct reply to you.

Why should me adding an edit that is a quote to an actual post you made carry any extra weight? Why is that more important than me completely obliterating this post and replacing it with a zebra picture :slight_smile:


I think we should simplify here… only one notification per post of type mention/direct reply… ever.

I suspect part of this issue got introduced by this @pmusaraj ? Do not collapse quote notifications · discourse/discourse@27387b0 · GitHub


I understand you, let’s simplify that.

I thought there is a notification when just edit a direct reply, if not, let’s follow that pattern.

It is a small risk like for example, you will write a post like
“Hey Kris, could you finish that feature?”
I will answer
“Sure, no worries”
Then, next week you will change the original message to “hey Kris, could you lend me 1 million dollars?”
In that case, I will never know you asked me for a favor :slight_smile:

Nevertheless, it sounds like a very edge case :slight_smile:

I think that case is already not handled, the strange handling we have now is:

At this point, currently you have not gotten any dupe notifications, you are only notified of the initial reply. The strange edge case we have is that after all of this you add a quote:

… and then you get a dupe notification.

This new notification just does not make sense, cause you already promised me 1 million dollars and we told you nothing about that



For what it’s worth, I do think getting edit notifications would be a valuable future enhancement. Within reason of course. Maybe a couple hours or something like that.

The main use case that I’ve encountered is when you’re asking for help. Someone replies and you read that reply right away. It’s not uncommon for them to edit the reply with more details or clarification, often within minutes of the original reply being posted.

1 Like

I had a look at this to refresh my memory. Right now, we notify on edit if it’s a new type of notification. That is, if post is edited and a quote is added, a notification is sent. Same thing when adding a link or a mention. (That said, editing multiple times and adding one quote after another will not send multiple notifications. Only the first notification of its type will be sent. See this in post_alerter.rb for context.)

I see this as a feature and not a bug, it’s a compromise between a) not sending any notifications at all on edit and b) sending a notification on every edit.

That said, if we want to stop these quote/link/mention notifications on edit, this would be a good place to do the skipping: