Page MenuHomePhabricator

"Uncaught (in promise) undefined" when trying to go over max number of favourite templates
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

When trying to add the 51st favourite template, I see in the console:

Uncaught (in promise) undefined

Happens for VisualEditor and WikiEditor.

I don't see anything bad happen as a result of this.

Steps to reproduce problem
  1. Login to https://en.wikipedia.beta.wmflabs.org
  2. Go to https://en.wikipedia.beta.wmflabs.org/w/index.php?title=BeforeEach-name-0.4566901484662702-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n&action=edit
  3. Add 50 favourite templates
  4. Open the browser console
  5. Try to add another template to your favourites
    1. Also repeat this in the VisualEditor

(Locally you could also set something like $wgTemplateDataMaxFavorites = 5 so you only need to add 5 favourite templates in step 3.)

Environment

Browser: Firefox 128. Chromium 135.
Wiki(s): https://en.wikipedia.beta.wmflabs.org TemplateData 0.2.0 (8bb5fb2) 07:29, 22 April 2025.
Editor: WikiEditor 0.5.4 (5c0d64c) 07:35, 21 April 2025. VisualEditor – (0c40a9a) 07:29, 22 April 2025.

Event Timeline

Change #1138944 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/TemplateData@master] Fix rejected 'save' promise handling

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

Change #1138944 merged by jenkins-bot:

[mediawiki/extensions/TemplateData@master] Fix rejected 'save' promise handling

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

I haven't seen an exception when going over 50 templates on enwiki beta.