Page MenuHomePhabricator

DiscussionTools: unable to save comment on metawiki with comment-became-transcluded error
Closed, ResolvedPublic

Description

On https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2023/New_contributors I want to save a reply to a comment. When I press "Reply", I see "Your comment could not be published to the most recent version of the page. To see the latest changes, copy your drafted comment and then use your browser to reload the page. ". If I reload the page, I see that VE restores my unsaved changes, and I get the error again.

The error response:

{
	"errors": [
		{
			"code": "comment-became-transcluded",
			"html": "<p>Your comment could not be published to the most recent version of the page. To see the latest changes, copy your drafted comment and then use your browser to reload the page.\n</p><!--__DTHASLEDECONTENT__--><!--__DTEMPTYTALKPAGE__-->",
			"module": "discussiontoolsedit"
		}
	]
}

The comment:

image.png (1×1 px, 300 KB)

The error occurs in both Visual and Source modes.

Event Timeline

Hmm, Your comment will be saved at Community Wishlist Survey 2023/New contributors/First edit tutorial looks suspicious.

Hmm, Your comment will be saved at Community Wishlist Survey 2023/New contributors/First edit tutorial looks suspicious.

This looks correct, the comment you're replying to is transcluded from https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2023/New_contributors/First_edit_tutorial, and the reply should go there. The question is why doesn't it get saved.

Can you also copy the API *request*? I'm curious what parameters it's using when trying to save.

Can you also copy the API *request*? I'm curious what parameters it's using when trying to save.

Sure, here is the request (with some tokens scrubbed out):

-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="action"

discussiontoolsedit
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="format"

json
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="formatversion"

2
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="uselang"

en
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="paction"

addcomment
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="useskin"

vector-2022
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="errorformat"

html
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="errorlang"

en
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="errorsuselocal"

true
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="page"

Community_Wishlist_Survey_2023/New_contributors/First_edit_tutorial
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="commentname"

c-TheDJ-20230123194200
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="summary"

/* Discussion */ Reply
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="assert"

user
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="assertuser"

KHarlan (WMF)
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="dtenable"

1
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="dttags"

discussiontools,discussiontools-reply,discussiontools-visual
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="html"

<p>+1 @<a href="./User:TheDJ" rel="mw:WikiLink" title="User:TheDJ">TheDJ</a> I was going to say the same :) @<a href="./User:Cardofk" rel="mw:WikiLink">Cardofk</a>could you please give Suggested Edits a try on <a href="https://en.wikipedia.org/wiki/Special:Homepage" rel="mw:ExtLink">https://en.wikipedia.org/wiki/Special:Homepage</a> and let us know what you think about it?</p>
-----------------------------236687329018984761223071665187
Content-Disposition: form-data; name="watchlist"

unwatch

Not sure this if this is related. I saw this in my browser console but I'm not sure if it appeared before or after attempting to save:

jQuery.Deferred exception: can't access property "getMenuItemForSuggestion", this.action is undefined ve.ui.CompletionWidget.prototype.update/<@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:801:779
mightThrow@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:350:881
Deferred/then/resolve/</process<@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:351:544
setTimeout handler*Deferred/then/resolve/<@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:351:875
fire@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:347:934
fireWith@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:349:135
fire@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:349:179
fire@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:347:934
fireWith@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:349:135
mightThrow@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:351:487
Deferred/then/resolve/</process<@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:351:544
setTimeout handler*Deferred/then/resolve/<@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:351:875
fire@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:347:934
fireWith@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:349:135
fire@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:349:179
fire@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:347:934
fireWith@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:349:135
mightThrow@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:351:487
Deferred/then/resolve/</process<@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:351:544
setTimeout handler*Deferred/then/resolve/<@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:351:875
fire@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:347:934
fireWith@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:349:135
fire@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:349:179
fire@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:347:934
fireWith@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:349:135
Deferred/</deferred[tuple[0]]@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:352:632
ajax/xhr<@https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2023/New_contributors/First_edit_tutorial line 10 > injectedScript:621:413
fire@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:347:934
fireWith@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:349:135
done@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:431:802
send/callback/<@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:435:452
EventHandlerNonNull*send@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:435:673
ajax@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:430:521
ajax@https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2023/New_contributors/First_edit_tutorial line 10 > injectedScript:620:780
get@https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2023/New_contributors/First_edit_tutorial line 10 > injectedScript:619:386
dt-ve/dt.ui.UsernameCompletionAction.js/MWUsernameCompletionAction.prototype.getSuggestions@https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2023/New_contributors/First_edit_tutorial line 10 > injectedScript:262:361
ve.ui.CompletionWidget.prototype.update@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:801:707
ve.ui.CompletionWidget.prototype.onModelSelect@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:803:11
OO.EventEmitter.prototype.emit@https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2023/New_contributors/First_edit_tutorial line 10 > injectedScript:250:656
ve.dm.Surface.prototype.changeInternal@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:175:391
ve.dm.Surface.prototype.change@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:174:92
ve.ce.Surface.prototype.changeModel@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:513:88
ve.ce.Surface.prototype.handleObservedChanges@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:489:473
ve.ce.SurfaceObserver.prototype.pollOnceInternal@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:519:833
ve.ce.SurfaceObserver.prototype.pollOnce@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:519:236
ve.ce.Surface.prototype.onDocumentInput@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:485:2
ve.EventSequencer.prototype.callListener@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:24:497
ve.EventSequencer.prototype.onEvent@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:21:915
VeEventSequencer/makeEventHandler/<@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:19:776
dispatch@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:371:260
add/elemData.handle@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:367:877
EventListener.handleEvent*add@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:368:662
on/<@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:367:166
each@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:306:285
each@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:304:93
on@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:367:137
on@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:366:680
on@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=spju4:377:95
ve.EventSequencer.prototype.attach@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:20:397
ve.ce.Surface.prototype.onDocumentFocus@https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=u9xgr:443:360
 undefined

I think the issue might be specific to something on Meta or the Community Wishlist Survey setup. During the development of the new version of AddMe (to be used for voting in the survey), we saw that the Reply tool worked fine on our very similarly structured pages at https://test.wikipedia.org/wiki/Wikipedia:AddMe-test (warning: large page and thus DT is slow). We were concerned very large pages might cause it to break, so I tried testing at another large page at https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2022/Larger_suggestions and I got the same error. I just assumed it was because the page was indeed too large.

We reworked a lot of the templates used in the survey during 2022, so it's quite possible some change there could be the cause of this. The basic structure of transclusions however is the same as always: the category page (such as Admins and patrollers) trancludes the proposal pages, where the comments should get saved on the latter.

I did a little bit of testing, and it's definitely related to having the {{Community Wishlist Survey/Proposal header|1=Auto-save feature}} template at the top of the page.

Looking at the parsoid source for a page with this template...

<section data-mw-section-id="0" about="#mwt8" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Community Wishlist Survey/Proposal header","href":"./Template:Community_Wishlist_Survey/Proposal_header"},"params":{"1":{"wt":"Auto-save feature"}},"i":0}},"\n&lt;!-- DO NOT EDIT ABOVE THIS LINE! PROPOSAL CONTENT IS NOW ON THE /Proposal SUBPAGE (FOR TRANSLATION) AND SHOULD NOT BE MODIFIED FURTHER -->\n\n=== Discussion ===\n&lt;!-- Discussion section, edit freely below! -- Discussion section, edit freely below! -->\n* I think that the major changes we could make to the existing autosave (without talk-to-Legal repercussions) are to add UI so it&apos;s more user-visible that it&apos;s happening, and to make it more durable -- it&apos;s currently in SessionStorage (which means it&apos;s great for the \"oops I reloaded the tab / navigated-away / my browser crashed\" cases but not for anything where you later come back in a different tab), which we picked because it mostly avoids us having to care about the many limits on LocalStorage. However, the [https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.storage new mw.storage API] got added very-recently and automates this sort of expiry-needed case which might make it more appealing to use for us.... Adding it to WikiEditor is of course doable, albeit as an entirely separate implementation. Promoting 2017 out of beta (even without changing any defaults) would be another way to make this more accessible with minimal changes needed...[[User:DLynch (WMF)|DLynch (WMF)]] ([[User talk:DLynch (WMF)|talk]]) 19:05, 25 January 2023 (UTC)\n*:Test [[User:DLynch (WMF)|DLynch (WMF)]] ([[User talk:DLynch (WMF)|talk]]) 16:39, 26 January 2023 (UTC)"]}' id="mwAQ"><p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Community Wishlist Survey/Proposal header","href":"./Template:Community_Wishlist_Survey/Proposal_header"},"params":{"1":{"wt":"Auto-save feature"}},"i":0}}]}' id="mwAg"><style data-mw-deduplicate="TemplateStyles:r22648737" typeof="mw:Extension/templatestyles" about="#mwt6" data-mw='{"name":"templatestyles","attrs":{"src":"Template:Community Wishlist Survey/Proposal header/styles.css"}}'>.mw-parser-output .community-wishlist-proposal-header+ul .ext-discussiontools-init-replylink-buttons,.mw-parser-output .community-wishlist-proposal-header>ul .ext-discussiontools-init-replylink-buttons{display:none}</style><span about="#mwt6"><!--__DTHASLEDECONTENT__--><!--__DTEMPTYTALKPAGE__--></span></p><span about="#mwt1">
</span></section>
<section data-mw-section-id="-1" about="#mwt8" id="mwAw"><h2 about="#mwt1" id="Auto-save_feature">Auto-save feature</h2><span about="#mwt1" id="mwBA">
</span><div style="" about="#mwt1" id="mwBQ"><span class="plainlinks" id="mwBg"><a rel="mw:ExtLink" href="//meta.wikimedia.org/w/index.php?title=User_talk:DLynch_(WMF)/Sandbox/Auto-save_feature&amp;action=edit" class="external text" id="mwBw"><span class="mw-ui-button community-wishlist-edit-proposal-btn" role="button" id="mwCA"><bdi lang="en" id="mwCQ">Edit proposal/discussion</bdi></span></a></span></div><span about="#mwt1" id="mwCg">
</span><p about="#mwt1" id="mwCw"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r22648737" about="#mwt7" typeof="mw:Extension/templatestyles" data-mw='{"name":"templatestyles","attrs":{"src":"Template:Community Wishlist Survey/Proposal header/styles.css"}}' id="mwDA"/><span about="#mwt7"><!--__DTHASLEDECONTENT__--><!--__DTEMPTYTALKPAGE__--></span></p><div style="" class="community-wishlist-proposal-header" about="#mwt1" id="mwDQ"></div>
<!-- DO NOT EDIT ABOVE THIS LINE! PROPOSAL CONTENT IS NOW ON THE /Proposal SUBPAGE (FOR TRANSLATION) AND SHOULD NOT BE MODIFIED FURTHER -->

<section data-mw-section-id="1" id="mwDg"><h3 id="Discussion">Discussion</h3>
<!-- Discussion section, edit freely below! &#x2D;&#x2D; Discussion section, edit freely below! -->
<ul id="mwDw"><li id="mwEA">I think that the major changes we could make to the existing autosave (without talk-to-Legal repercussions) are to add UI so it's more user-visible that it's happening, and to make it more durable -- it's currently in SessionStorage (which means it's great for the "oops I reloaded the tab / navigated-away / my browser crashed" cases but not for anything where you later come back in a different tab), which we picked because it mostly avoids us having to care about the many limits on LocalStorage. However, the <a rel="mw:ExtLink" href="https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.storage" class="external text" id="mwEQ">new mw.storage API</a> got added very-recently and automates this sort of expiry-needed case which might make it more appealing to use for us.... Adding it to WikiEditor is of course doable, albeit as an entirely separate implementation. Promoting 2017 out of beta (even without changing any defaults) would be another way to make this more accessible with minimal changes needed...<a rel="mw:WikiLink" href="./User:DLynch_(WMF)" title="User:DLynch (WMF)" id="mwEg">DLynch (WMF)</a> (<a rel="mw:WikiLink" href="./User_talk:DLynch_(WMF)" title="User talk:DLynch (WMF)" id="mwEw">talk</a>) 19:05, 25 January 2023 (UTC)
<dl id="mwFA"><dd id="mwFQ">Test <a rel="mw:WikiLink" href="./User:DLynch_(WMF)" title="User:DLynch (WMF)" id="mwFg">DLynch (WMF)</a> (<a rel="mw:WikiLink" href="./User_talk:DLynch_(WMF)" title="User talk:DLynch (WMF)" id="mwFw">talk</a>) 16:39, 26 January 2023 (UTC)</dd></dl></li></ul>
</section></section>

...the template clearly is absorbing everything following it, leading DT to think that it's being asked to edit a comment that's contained within a template.

The template is sufficiently challenging to read that someone else might have better luck than me untangling what about it is leading to it not being closed...

I don't actually see anytihng wrong with the template, it's just confusing because it can generate quite a bit of output transcluded from the translateable /Proposal subpages, e.g. on [1]. But as far as I can tell, only content that really is transcluded is marked as transcluded.

It's confusing to debug this, because on other pages the content isn't transcluded because it's not ready for translation (e.g. [2]), and on others it isn't transcluded but it is actually translateable (e.g. [3]).

[1] https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2023/Editing/Auto-save_feature
[2] https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2023/Admins_and_patrollers/Show_subcategories_by_selecting_related_changes_of_a_category
[3] https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2023/Editing/VisualEditor:_Allow_references_to_be_properly_named

I think we're missing a call to CommentUtils::unwrapParsoidSections() in ApiDiscussionToolsEdit. WIthout it, when a transclusion covers a section boundary, both whole sections are considered to be transcluded. We have the same call in ApiDiscussionToolsPageInfo and elsewhere (by way of HookUtils::parseRevisionParsoidHtml), but the edit action uses a different mechanism for some RESTBase-related reasons I don't exactly remember.

Change 884057 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] ApiDiscussionToolsEdit: Unwrap Parsoid sections before parsing

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

Maybe we could even backport this today.

Maybe we could even backport this today.

If someone is around to do code review, let's do it.

Change 884013 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@wmf/1.40.0-wmf.20] ApiDiscussionToolsEdit: Unwrap Parsoid sections before parsing

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

Change 884057 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] ApiDiscussionToolsEdit: Unwrap Parsoid sections before parsing

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

Change 884013 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@wmf/1.40.0-wmf.20] ApiDiscussionToolsEdit: Unwrap Parsoid sections before parsing

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

Mentioned in SAL (#wikimedia-operations) [2023-01-26T21:27:21Z] <thcipriani@deploy1002> Started scap: Backport for [[gerrit:884013|ApiDiscussionToolsEdit: Unwrap Parsoid sections before parsing (T327704)]]

Mentioned in SAL (#wikimedia-operations) [2023-01-26T21:28:59Z] <thcipriani@deploy1002> matmarex and thcipriani: Backport for [[gerrit:884013|ApiDiscussionToolsEdit: Unwrap Parsoid sections before parsing (T327704)]] synced to the testservers: mwdebug1002.eqiad.wmnet, mwdebug2002.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2001.codfw.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-01-26T21:36:04Z] <thcipriani@deploy1002> Finished scap: Backport for [[gerrit:884013|ApiDiscussionToolsEdit: Unwrap Parsoid sections before parsing (T327704)]] (duration: 08m 43s)

Some closing notes:

The issue was caused by my changes from T313100: Reply tool corruption involving {{Desbloqueo revisado}} on es.wp. Prior to that change the code didn't check whether a comment was transcluded and error out if so, but rather tried to add a reply anyway and error out if it did not work. That's presumably why replying on the wishlist pages worked fine last year, but on other pages it caused the issue described in that task.

I checked the error logs, and the issue has affected some other pages as well, but there were only a few errors per day, which apparently wasn't enough for anyone to complain or for us to notice – until the Community Wishlist Survey started, producing the big spike.

Comparing the rates of the new error message comment-became-transcluded after that change to the old one comment-comment-not-saved:

image.png (1×2 px, 34 KB)

Query for reference:

select
  date(from_iso8601_timestamp(dt)),
  count_if(event.save_failure_message = 'comment-became-transcluded') as "comment-became-transcluded",
  count_if(event.save_failure_message = 'comment-comment-not-saved') as "comment-comment-not-saved"
from editattemptstep
group by date(from_iso8601_timestamp(dt))
order by 1