Page MenuHomePhabricator

Add link: Edits on Add link articles are automatically removed by subsequent Add link edits
Open, HighPublic

Description

Tested on testwiki wmf.5.

  1. On an article with suggested Add links, click on Edit tab link and open it in a different tab. So there are two tabs -the tab #1 in Add link mode and the tab # with VE mode.
  2. In the browser tab #2 (with the article opened in VE mode), make some edits. Publish them (save the edits).
  3. In the browser tab #1 (with the article opened in Add link mode), answer 'Yes' or 'No' and save your edits.

Saving Add link answers will remove the previous edits. The View history will display for the case Link suggestions: 0 accepted, 1 rejected, 1 skipped.

The links to compare the revisions:

Notes:

  • Tag Newcomer task Suggested: add links is added to an edit made outside the suggested Add link interface
  • there might be many ways when a user makes edits on an article that has a suggested Add link: find it randomly when reading and start editing; seeing an article in SE module and open it for editing in a separate window and edit it etc.

Event Timeline

This task might be a subtask of T269653: Add a link: edit mode toggle
However, some of the specs on T269653 might need more details.
For example,

Users cannot combine link suggestions with other kinds of edits. They can do one or the other. If they leave "AI suggestions" mode, their progress is gone. Same with if they toggle over to visual or source mode, make some changes, and then toggle back to AI suggestions mode: their progress is gone.

Although, presently, the toggle between Edit and Edit source is disabled, there are other ways to make edits on the Add link articles; edits can be done before adding links as described in this task. In this case, for a user it's difficult to make a connection between two modes - and losing their progress seems abrupt.

Etonkovidova renamed this task from Add link: Edits on Add link articles are automatically removed by subseqeunt Add link edits to Add link: Edits on Add link articles are automatically removed by subsequent Add link edits.May 19 2021, 3:02 AM

Is it different from what happens when you have VE in both tabs? This sounds like a failure to raise an edit conflict, and I don't think we change anything related to that.

Is it different from what happens when you have VE in both tabs? This sounds like a failure to raise an edit conflict, and I don't think we change anything related to that.

I suppose we could look at the edit before save and inspect the previous edit (was it done with add links? and/or by the previous user?) and reject the edit if needed. But it sounds like more effort than it is worth, IMO. cc @MMiller_WMF

Add Link edits accidentally damaging the article is somewhat serious, IMO. VE should show an error to the user when the save failed due to an edit conflict - maybe the customizations to the save form somehow broke that.

kostajh triaged this task as Medium priority.Wed, May 26, 1:20 PM

Add Link edits accidentally damaging the article is somewhat serious, IMO. VE should show an error to the user when the save failed due to an edit conflict - maybe the customizations to the save form somehow broke that.

The scenario @Etonkovidova listed has the same results with regular VisualEditor as it does when the AddLink interface is involved.

Some changes we could make:

  • before save, check that the content is from the latest revision and fail if there's a newer revision (would require instrumentation plus UI to inform the user about what is going on)
  • if the user has done reject/skip all actions (no saves) then load the most recent revision before saving the document to avoid overwriting an older document
MMiller_WMF raised the priority of this task from Medium to High.Mon, Jun 7, 5:11 PM
kostajh added a subscriber: RHo.

@RHo the proposed change to the workflow (that the user doesn't see) is, when "Save" is pressed (the edit summary is loading), and again just before Publish is pressed (from the edit summary), we'd check to see if the suggestions being added correspond to the latest revision of the article.

If there's a mismatch, it means someone edited the article while the user had the add link interface open. What should the user see, and should we redirect the user back to Special:Homepage?

We can potentially try to fetch new link suggestions on demand if this scenario comes up. So the user sees a message like "The article was edited, do you want to get new suggestions for the updated article?", and in the background we call the link recommendation service. That could potentially return no results, but would probably be more likely to return new suggestions. The downside is that it would take up to 10 seconds to fetch suggestions. And the user would have to start the yes/no/skip process over again.

Maybe the simplest thing for now is to surface an error message to the user, and take them back to Special:Homepage.

@RHo the proposed change to the workflow (that the user doesn't see) is, when "Save" is pressed (the edit summary is loading), and again just before Publish is pressed (from the edit summary), we'd check to see if the suggestions being added correspond to the latest revision of the article.

If there's a mismatch, it means someone edited the article while the user had the add link interface open. What should the user see, and should we redirect the user back to Special:Homepage?

We can potentially try to fetch new link suggestions on demand if this scenario comes up. So the user sees a message like "The article was edited, do you want to get new suggestions for the updated article?", and in the background we call the link recommendation service. That could potentially return no results, but would probably be more likely to return new suggestions. The downside is that it would take up to 10 seconds to fetch suggestions. And the user would have to start the yes/no/skip process over again.

Maybe the simplest thing for now is to surface an error message to the user, and take them back to Special:Homepage.

Hi @kostajh - up to 10secs to return new suggestions seems like quite a long time, plus there being a chance that no new suggestions would be found. So I agree the better option is to show an error message and take them back to the homepage.
Maybe something like Another edit was while you were reviewing this article, and your changes could not be saved. with the CTA to go "Back to the homepage"?

Hi @kostajh - up to 10secs to return new suggestions seems like quite a long time, plus there being a chance that no new suggestions would be found. So I agree the better option is to show an error message and take them back to the homepage.
Maybe something like Another edit was while you were reviewing this article, and your changes could not be saved. with the CTA to go "Back to the homepage"?

That sounds good.

The default error flow in VisualEditor when a problem occurs after "Publish changes" is pressed is the following:

So we would replace the text in the red box with Another edit was while you were reviewing this article, and your changes could not be saved. and the "Dismiss" with "Go back to Special:Homepage"? Would you still want the red box and icon styling?

Hi @kostajh - up to 10secs to return new suggestions seems like quite a long time, plus there being a chance that no new suggestions would be found. So I agree the better option is to show an error message and take them back to the homepage.
Maybe something like Another edit was while you were reviewing this article, and your changes could not be saved. with the CTA to go "Back to the homepage"?

That sounds good.
The default error flow in VisualEditor when a problem occurs after "Publish changes" is pressed is the following:


So we would replace the text in the red box with Another edit was while you were reviewing this article, and your changes could not be saved. and the "Dismiss" with "Go back to Special:Homepage"? Would you still want the red box and icon styling?

Replacing the text and button sounds good, but without the red box and icon styling please. Alternatively, could we use the standard simple message dialog that we use when users come to an article without suggestions?

Also, maybe it's better to have "back to suggested edits" as the CTA for consistency (with the dialog when there are no suggested links), and since on Mobile we want to return them to the full-screen suggested edits module rather than the homepage.

If we use the alert dialog we use elsewhere, it looks a little awkward stacked on top of the VE dialog

IMO it would probably fit better to override the contents of the "Something went wrong" dialog shown in VE.

If we use the alert dialog we use elsewhere, it looks a little awkward stacked on top of the VE dialog


IMO it would probably fit better to override the contents of the "Something went wrong" dialog shown in VE.

Ahh I was hoping it could appear in place of instead of being stacked on top of the VE dialog. Happy to go with your original plan of overriding the "Something went wrong" dialog then.

If we use the alert dialog we use elsewhere, it looks a little awkward stacked on top of the VE dialog


IMO it would probably fit better to override the contents of the "Something went wrong" dialog shown in VE.

Ahh I was hoping it could appear in place of instead of being stacked on top of the VE dialog. Happy to go with your original plan of overriding the "Something went wrong" dialog then.

Hmm, well, I'll try first to hide the publish dialog and raise the alert dialog, hopefully that works OK.

Change 699409 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/VisualEditor@master] Introduce VisualEditorApiVisualEditorPreSaveHook

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

Change 699410 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] [WIP] AddLink: Ensure revision has suggestions before saving

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

After reviewing the task, I did more testing I to see how (or if) VE raises conflict for normal edits. VE differentiates between edits done by one user making edits, say, in two different tabs and two different users trying to save edits on the same article.

For a user who does editing in two different tabs - the saving is straightforwardly logical. Only the most recent edit (based on the timestamp) will be saved - this is what @kostajh wrote in https://phabricator.wikimedia.org/T283109#7119068 . For 'Add link' tasks the behavior is exactly the same as for normal VE edits. This, in a sense, invalidates the issue. Arguably, some improvements should be made - from a user point of view, adding links task might look totally different from normal editing, so to see edits disappear is more confusing in this case. It'd be great if it'd be improved.

Presently for two different users making normal edits on the same article, the warning would appear - even if edits are just adding separate pieces of content which do not conflict per se.