Page MenuHomePhabricator

Hygiene: Don't use .done, use promises A/A+
Closed, ResolvedPublic

Description

Remove usages of .done/.fail/.always and use promises A/A+ instead (.then/.catch)

Noticed when signing off T170812: Return promises from QUnit tests

Details

Related Gerrit Patches:
mediawiki/extensions/Popups : masterHygiene: Don't rely on .fail, use Promises/A+
mediawiki/extensions/Popups : masterHygiene: Use promises A/A+ everywhere

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 22 2017, 11:27 AM

Change 373054 had a related patch set uploaded (by Jhernandez; owner: Jhernandez):
[mediawiki/extensions/Popups@master] Hygiene: Use promises A/A everywhere

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

Change 373054 merged by jenkins-bot:
[mediawiki/extensions/Popups@master] Hygiene: Use promises A/A everywhere

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

There's one usage of fail in src/actions.js
Should that be a catch?

@Jdlrobson I saw that but .fail is not compatible with .catch straight forward. Specially when chaining promises like on this case where after that there is a $.when with to promises.

We need to be sure the semantics of the change are the same when we migrate that line to .catch.

You're right tho, that is part of this task... I'll see if I can work it out.

Change 373327 had a related patch set uploaded (by Jhernandez; owner: Jhernandez):
[mediawiki/extensions/Popups@master] Hygiene: Don't rely on .fail, use Promises/A

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

Change 373327 merged by jenkins-bot:
[mediawiki/extensions/Popups@master] Hygiene: Don't rely on .fail, use Promises/A

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

Jdlrobson closed this task as Resolved.Aug 23 2017, 6:40 PM

Technical task. Signing off.