Page MenuHomePhabricator

Poll for new replies in the section you are replying in
Closed, ResolvedPublic

Description

Will be used by T250295, and then connected to T300502

Proposed implementation:

  1. Send an API request with the last checked revision ID
  2. Do a quick check to see if the revision ID has changed
  3. If it has, comment parse the two revisions and see if there are any new comments in the new section
  4. Always return the new revision ID
  5. If there is a new comment(s) return metadata about it.
  6. The client checks if the new comment(s) is in the right section, then displays a notification

Event Timeline

I think we can separate out the new API in this commit and build on it: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/714059

If we have a generic commentdiff API that returns metadata of added/removed comments between two revisions (with "latest" allowed as an input) then this would satisfy this use case as well as T281624.

Change 758479 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/DiscussionTools@master] Add commentdiff API

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

Change 758485 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/DiscussionTools@master] WIP Poll for new comments in the section you are replying in

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

Question: Should we filter out new comments added by yourself (e.g. in another tab)?

Test wiki created on Patch demo by ESanders (WMF) using patch(es) linked to this task:

https://patchdemo.wmflabs.org/wikis/ff143b20a8/w/

Polling timing
As discussed during today's team standup:

  1. To start, the feature will "poll" for new comments every 5 seconds
  2. If/when this polling cadence proves insufficient (e.g. people are consistently publishing comments and, to their surprise, finding new comments posted to the discussion they had not been alerted about), we will consider making revisions to the approach "1." describes.
    • One idea that came up: when people click/tap Reply, check whether any new comments have been posted to the discussion. If any new comments have been posted, do not publish the comment someone had been attempting to publish and instead, ask them to review the new comment that was posted or carry on with publishing the comment they originally intended to.

Question: Should we filter out new comments added by yourself (e.g. in another tab)?

To start, yes.

Thinking: let's stay true to the need this functionality is being designed to meet [i].

NOTE: I've updated T250295 to reflect the above.

i. Inform people when someone else changed the discussion they are drafting a comment with in so that they can decide whether they would like to make any changes to what they were drafting.

Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/ff143b20a8/w/

Test wiki created on Patch demo by ESanders (WMF) using patch(es) linked to this task:

https://patchdemo.wmflabs.org/wikis/4e3b69dcb8/w/

Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/4e3b69dcb8/w/

Test wiki created on Patch demo by ESanders (WMF) using patch(es) linked to this task:

https://patchdemo.wmflabs.org/wikis/3d0dbc0868/w/

The easiest way to test is to open the reply tool on an old revision of the page, so open a reply in this section:

https://patchdemo.wmflabs.org/wikis/c555f5ca84/w/index.php?title=Talk:DiscussionTools&oldid=23#Skip_to_Top_and_Skip_to_Bottom_arrows

You should eventually see "1 new comments have been added in this section." (Patch Demo is no the fastest)

Change 759352 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/DiscussionTools@master] Show error message as soon as we detect the parent comment has been deleted

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

Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/3d0dbc0868/w/

Test wiki created on Patch demo by ESanders (WMF) using patch(es) linked to this task:

https://patchdemo.wmflabs.org/wikis/c555f5ca84/w/

Change 758479 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Add discussiontoolscompare API

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

ppelberg claimed this task.

Change 758485 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Poll for new comments in the section you are replying in

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

Change 759352 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Show error message as soon as we detect the parent comment has been deleted

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

Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/c555f5ca84/w/