30

I just received a ping in my notifications that a comment was addressed to me. Nothing odd about that, it's just that said comment addressed me with a @ second. (Recording the comment here, in case the post goes 10k only)

I am still not clear. The firstcase assigns ptr as a pointer to the first element of array. The second case is also assignig a pointer arr to array.@SouravGhosh @StoryTeller

In my understanding, only the first user being mentioned is actually addressed. So this caught me by surprise.

Is this a new feature, or some bug1?


1 Despite my initial excitement, it's in fact a buggy feature. The sequence .@ prevents @ from being interpreted as a user mention. But the auto-complete works...

20
  • 22
    hypothesis: I wonder whether the .@ meant that the first mention wan't interpreted as a mention
    – Marc Gravell Mod
    Commented Feb 15, 2018 at 11:46
  • @MarcGravell - Well, I'm starting to feel silly Commented Feb 15, 2018 at 11:48
  • @StoryTeller @Marc : I'm often use a comment format like this, to make it clear I also want to address the OP. May be you met that from someone else.
    – user9212993
    Commented Feb 15, 2018 at 11:58
  • @TheDude - I linked to the original comment. The other person that was mentioned isn't the OP. In fact, it was the OP writing that comment. Commented Feb 15, 2018 at 12:02
  • 19
    Just to confirm: you were notified, Sourav was not (moderators can see your responses tab).
    – Martijn Pieters Mod
    Commented Feb 15, 2018 at 12:16
  • @MartijnPieters - I guess ultimately that's my answer Commented Feb 15, 2018 at 12:18
  • 18
    @MartijnPieters something something answers as comments
    – TylerH
    Commented Feb 15, 2018 at 14:00
  • 2
    @StoryTeller answer aside, this feature really ought to be added to the network. It's massively useful.
    – TylerH
    Commented Feb 15, 2018 at 14:01
  • 1
    @TylerH - I totally agree with you. My own haste in posting was due to excitement about the possibility of this already happening :) Commented Feb 15, 2018 at 14:02
  • 2
    test .@MarcGravell will you get notified or will @MartijnPieters only get a notification?
    – Tanner
    Commented Feb 15, 2018 at 14:12
  • 2
    @Tanner I didn't get the first notification
    – Marc Gravell Mod
    Commented Feb 15, 2018 at 14:16
  • 2
    I don't believe that this is a bug. Any leading character has always acted as an escape and prevented notification: meta.stackoverflow.com/a/303565/603977
    – jscs
    Commented Feb 15, 2018 at 14:37
  • 5
    .@JoshCaswell since the auto-completion feature seems to allow such leading character, it is a bug of at least one of the features.
    – Kaiido
    Commented Feb 15, 2018 at 14:45
  • 1
    @Sinatr - The bug was reproduced in the comments here. It's not a ninja edit problem. Commented Feb 15, 2018 at 14:46
  • 1
    @StoryTeller: Good work, thanks! Now you're telling a story :P Commented Feb 17, 2018 at 16:22

1 Answer 1

47

From How do comment @replies work?:

The notification must begin with a space or be at the start of the comment.

So .@ does not accomplish the (\s|^)@ pattern and hence does not trigger the notification.

17
  • 23
    Up-voted. But then like Kaiido points out, it shouldn't suggest to autocomplete with a user's name. Commented Feb 15, 2018 at 14:51
  • 3
    .@StoryTeller agreed (did you get the notification? <-- joking, you got it because no one else commented here :P)
    – fedorqui
    Commented Feb 15, 2018 at 14:52
  • I never expected regular expressions here! Commented Feb 15, 2018 at 14:55
  • 2
    Wow, that's a great example of a terrible regex. What's wrong with \b? Or, y'know, not using regexes? Commented Feb 16, 2018 at 13:39
  • 4
    @LightnessRacesinOrbit Unless I've missed something, I don't see any indication in that thread of what the regex they actually use is, or even if they do. (Although how else would you do it?) \b wouldn't work as @ isn't a word character...
    – Rawling
    Commented Feb 16, 2018 at 14:05
  • @LightnessRacesinOrbit Hey, wait a second. Not using regexes? Next you'll suggest we don't dereference dangling pointers to save on memory allocations (after all, using memory through a dangling pointer saves on new allocations). Madness. Commented Feb 16, 2018 at 15:15
  • @Yakk: I know, right? Where will it end?! Commented Feb 16, 2018 at 15:35
  • @Rawling: Okay, "Wow, that's a great example of a terrible piece of logic, that you happen to have rendered in the form of a regex". Not sure what @'s got to do with it; the \b is for matching the non-word characters before the @. Commented Feb 16, 2018 at 15:36
  • @LightnessRacesinOrbit I don't see why? \b is not the same as (\s|^) since it matches in many more cases... Commented Feb 16, 2018 at 15:37
  • @GiacomoAlzetta: Yes, exactly. Commented Feb 16, 2018 at 15:37
  • 1
    Snippets of code should be surrounded by backticks, just as you did in your comment. If someone uses @ inside a comment without backticks and they meant to write code, there are still plenty of chances for that to result in a notification, with the logic as it is now. That is really not a good reason to silently break notifications in other cases, like this (@GiacomoAlzetta) Commented Feb 16, 2018 at 15:42
  • 2
    @LightnessRacesinOrbit \b matches a boundary between a word char and a non-word char. Thus it won't match e.g. in the middle of ` @` as that's two non-word chars.
    – Rawling
    Commented Feb 16, 2018 at 15:45
  • 1
    @Rawling: Derp. Okay (?!<\W)@ then! My point is that I think individually whitelisting characters is the wrong approach, particularly when limiting it to only one of them (plus start-of-line). Commented Feb 16, 2018 at 15:46
  • 2
    Well, let's test this. Did @LightnessRacesinOrbit receive a notification? Commented Feb 17, 2018 at 15:03
  • 3
    @HermannDöppes: Well... blimey! Commented Feb 17, 2018 at 15:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .