Page MenuHomePhabricator

Check front end code for unawaited promises
Open, Needs TriagePublic

Description

  • Check front end code for unawaited promises. Can create race conditions and intermittent, hard to diagnose bugs
  • See if there is an eslint rule we can add so that static analysis detects and warns about these

@MPGuy2824 thinks that new mw.Api().postWithToken without a return before it might be a red flag for this and might need refactoring. We have 5 of these.

  • modules/ext.PageTriage.enqueue/ext.PageTriage.enqueue.js - This seems fine since the page reload action is in the then() section
  • modules/ext.pageTriage.views.toolbar/mark.js - This seems fine since the page isn't refreshed
  • modules/ext.pageTriage.views.toolbar/next.js - This seems fine since setting the window.location.href is in the then() section
  • modules/ext.pageTriage.views.toolbar/tags.js (2) - actionQueue is involved here along with code duplication (checked by Chlod on 2023-09-04)

Sounds like @Chlod intends to look over the code and help with this when he gets time.