If we go straight to the WT surface using veaction=editsource, we don't bother loading the HTML document form RESTBase, which means we don't get an etag. Without an etag we can't ask for html->wikitext snippet conversions via the RB/VirtualRB.
Description
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T132023 VisualEditor support for editing inside CollaborationKit | |||
Open | Feature | None | T138636 Allow using VisualEditor on Special:MassMessage | ||
Open | None | T138642 VisualEditor should provide a clean integrated VE/WT editor widget that can be integrated into any context | |||
Open | None | T130400 (Actually) Add wikitext support for citoid for automatic reference insertion | |||
Open | None | T90864 Help VisualEditor users find the wikitext "Save" button | |||
Open | None | T171974 Improve and consolidate our unified editing platform so that it's great on all devices | |||
Open | None | T104479 Provide a modern wikitext editor | |||
Resolved | Jdforrester-WMF | T141149 Provide a Beta Feature of a modern wikitext editor integrated into the visual editor | |||
Invalid | None | T142861 Wikitext surface needs an etag to use RESTBase |
Event Timeline
I think maybe we should ask RESTBase for a GET call we can do to /page/wikitext/{title}//page/wikitext/{title}/{revision} that'd get the wikitext from MW (or it's own cache) and return it with an ETag?
Is this for the Service's team sanity/good logging, or does it break the editor in some way that I haven't noticed?
I'm not quite sure, but I think it might mean dirty diffs if you veaction=editsource, make changes, then switch to VE and save?
Without an etag we can't ask for html->wikitext snippet conversions via the RB/VirtualRB.
This doesn't seem to be quite right. We send a null etag to MultiHttpClient as the if-match header, it gets converted to an empty string by a trim() call in getCurlHandle, and it still works...
The ETag is used within RESTBase to locate the exact version of data-parsoid corresponding to the original HTML you've based your edit on. In RESTBase we require an ETag to be present either in If-Match header, or inlined in HTML with meta property=mw:TimeUuid element (less desirable). If we didn't require an ETag, if the page was rerendered (for example due to a template change and Change-Prop change) in the timeframe between the original HTML was requested and the transform request was submitted, the data-parsoid versions could mismatch leading to dirty diffs and all the other problems. So, you wouldn't see the issues all the time, but they would manifest sometimes.
I don't understand the problem though - if you are in the WT editor, why would you need to call html->wikitext transform? And if you're switching to HTML editor - don't you load the original HTML? Could you please tell more about your use-case?
Yesh - if you are using wikitext mode only we fetch wikitext directly from the PHP API, because there is no RESTBase API for getting wikitext. If we switch to VE, we use the same API calls as we currently use for switching from source mode.
I'm provisionally closing this as Invalid as it doesn't seem to be an issue. We can re-open if it turns out I'm wrong.