Page MenuHomePhabricator

No error handling (effectively error suppression) on Special:PagePreparation
Closed, ResolvedPublic2 Estimated Story Points

Description

Trying to create a saved diff for T342622: Clicking Prepare multiple times on Special:PagePreparation results in multiple diffs being appended

Event Timeline

I don't think it's feature is completely broken, as it worked on an untranslated page - https://www.mediawiki.org/w/index.php?title=User%3AReedy%2FTest&diff=6041122&oldid=566646

Either way, it shouldn't be failing silently and doing apparently nothing...

Trying another page https://www.mediawiki.org/wiki/Help:Categories/Test it seems there is again weirdness in the diff...

And on Publish,

{
	"error": {
		"code": "pt-shake-empty",
		"info": "Empty translation unit for marker \"3\".",
		"*": "See https://www.mediawiki.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
	},
	"servedby": "mw-api-ext.eqiad.main-5cf9879585-tlrxx"
}

Which is seemingly suppressed by the frontend JS. Nothing is shown at all.

Screenshot 2023-07-25 at 14.28.10.png (225×1 px, 15 KB)

It seems it does some weird duplication of syntax etc too. Which really becomes T342651: Special:PagePreparation should handled pages with translation markup better (or do nothing).

Reedy renamed this task from Publish button on Special:PagePreparation doesn't seem to be working to No error handling (effectively error suppression) on Special:PagePreparation.Jul 25 2023, 1:32 PM
Reedy updated the task description. (Show Details)

I think the TLDR for handling is using .fail() etc

Change 944244 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/Translate@master] WIP: PagePreparation: Add fail() handlers to api calls

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

abi_ triaged this task as Medium priority.
abi_ set the point value for this task to 2.

Change 944244 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] PagePreparation: Add/Improve error handling

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

abi_ subscribed.

We're ensuring that we now display errors (page to prepare does not exist) to the user. We've also added failure handlers for API call to display sensible/actionable error messages to users.

error-handling-pagepreparation.png (247×1 px, 13 KB)

Yay!

I'm sure there's always more we can do, but we're catching some (most?) of the errors that were annoying me at the time.

Can always file tasks down the line if/when I or anyone else finds any issues :)