Page MenuHomePhabricator

Implement Echo notification support into WikiForum
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):
Right now, there is no notification support for WikiForum that I can see. I'd like replies to a thread to appear as an alert in Echo.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
I was mentioned (through a user page wikilink) in a couple threads on a wiki and did not realise until someone pinged me on Discord. Another user on the forum also did not receive any notifications when I replied to his thread.

Benefits (why should this be implemented?):
If this is implemented it will make tracking discussions on WikiForum much easier.

Revisions and Commits

Event Timeline

Seemplez added a project: Social-Tools.
Seemplez moved this task from Backlog to WikiForum on the Social-Tools board.
Aklapper renamed this task from FR: Implementing Echo support into WikiForum to Implement Echo notification support into WikiForum.Feb 14 2022, 4:34 PM

Change 763565 had a related patch set uploaded (by Jack Phoenix; author: Jack Phoenix):

[mediawiki/extensions/WikiForum@master] Echo notifications support

https://gerrit.wikimedia.org/r/763565

Hm, someone did try to implement this but it was abandoned. Added the relevant commits.

Fascinating discovery, thanks for digging up those links!

So I took a look at this, having implemented Echo support previously for MediaWiki-extensions-Comments in 56f3ce75fd34 back in 2019 (it was no simple task!).
There was some additional complexity here due to the fact that WikiForum is a special page and comments on threads aren't associated with a page the same way they are in MediaWiki-extensions-Comments: the <comments /> tag must exist on a page for you to be able to comment on it, thus you can programmatically construct a WikiPage or an Article for any such page; but if memory serves me correctly, the aforementioned core MediaWiki classes will complain if you try to throw a SpecialPage (subclass) at them.

It's kind of an awful hack job, mostly based on the code in Comments and tweaked a bit to address the aforementioned WikiForum-specific limitation, but hopefully better than nothing.
Testing, improvements, comments, suggestions, etc. are more than welcome. :)

Oh wow, thanks! Me and a couple others from caps.wiki were working on adding Echo support but we definitely didn't get this far. I'll test it on my test instance and report any bugs/suggestions I have here.

@ashley Thanks for the patch! I'm one of the folks that was working on Echo support in WikiForum for caps.wiki. Taking a look at the patch, it seems that the Echo support is currently only for Mentions, is that correct?

I added some preliminary support for Echo notifications on a WFReply, ie. "notify thread posters of a new reply in a thread they replied on". It's still in-progress (no batch/bundle support yet). Is that something of interest for general integration?

I'm happy to see that my code followed a lot of the same thoughts as the code you posted.

One thing that I wanted to note (kind of addressed by the FIXME comment in WFReply) is that I started implementing a hook in WikiForum to handle notifications in general, so that additional non-Echo notification systems could be implemented in the future, if desired.

Is that something that makes sense?

Oh wow, thanks! Me and a couple others from caps.wiki were working on adding Echo support but we definitely didn't get this far. I'll test it on my test instance and report any bugs/suggestions I have here.

Cool, thank you! 😃

@ashley Thanks for the patch! I'm one of the folks that was working on Echo support in WikiForum for caps.wiki. Taking a look at the patch, it seems that the Echo support is currently only for Mentions, is that correct?

You're welcome! Yep, that is correct.

I added some preliminary support for Echo notifications on a WFReply, ie. "notify thread posters of a new reply in a thread they replied on". It's still in-progress (no batch/bundle support yet). Is that something of interest for general integration?

Certainly!

I'm happy to see that my code followed a lot of the same thoughts as the code you posted.

This may not exactly be my best work ever, but it works - and frankly a lot of the issues *do* arise from Echo itself and how it makes certain assumptions (regarding where/how/etc. notifications appear/work, and so on). I've submitted a tiny patch against Echo to hopefully eventually reduce the code duplication slightly and maybe in the future Echo itself could have better support for non-wikitext/non-ContentHandler-handled content formats (incl. notifications triggered by a NS_SPECIAL page).
Then again perhaps I'm being overly optimistic here.

One thing that I wanted to note (kind of addressed by the FIXME comment in WFReply) is that I started implementing a hook in WikiForum to handle notifications in general, so that additional non-Echo notification systems could be implemented in the future, if desired.

Is that something that makes sense?

Most definitely! 👍

Awesome! Thanks for the feedback. In the next day or two, I'll pull your code in and work on integrating my changes.

One of the things I'm waiting for is general feedback on whether other notifications aside from Mentions and Replies would be desired. If there are any thoughts on that (ie. notifications on Category, Forum, and Thread creation) feel free to chime in.

I'm also hoping to get around to implementing bundling at _some_ point in the near future, and maybe eventually some nice-to-haves like image previews, etc.

Any other general ideas that I can implement while I'm at it are welcome.

This may not exactly be my best work ever, but it works...

"If it looks stupid, but it works...it's not stupid." 😂