Page MenuHomePhabricator

[mobile] AddLinkMobileSaveDialog: Cannot read property 'madeNullEdit' of null TypeError
Closed, ResolvedPublicBUG REPORT

Description

As a follow-up for https://phabricator.wikimedia.org/T283661#7151415

On mobile betalabs machine suggested add links tasks - upon saving add link answers ('yes', 'no', skipped), the Console displays multiple warnings

jQuery.Deferred exception: Cannot read property 'madeNullEdit' of null TypeError: Cannot read property 'madeNullEdit' of null
    at AddLinkMobileSaveDialog.<anonymous> (<anonymous>:27:491)
    at <anonymous>:143:84
    at mightThrow (https://en.m.wikipedia.beta.wmflabs.org/w/load.php?lang=el&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=minerva&version=dpq0j:49:833)
    at process (https://en.m.wikipedia.beta.wmflabs.org/w/load.php?lang=el&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=minerva&version=dpq0j:50:498) undefined

Event Timeline

kostajh changed the subtype of this task from "Task" to "Bug Report".
kostajh added a project: Add-Link.

Looking at the stack trace, the (incomplete) sequence of events upon save is:

  • Save completed
  • ve.init.mw.ArticleTarget.teardown
  • ve.init.Target.destroy --- after this ve.init.target is set to null
  • ve.init.mw.MobileArticleTarget.clearSurfaces
  • OO.ui.WindowManager.clearWindows --- at this point, getTeardownProcess for AddLinkSaveDialog is called

Since the ArticleTarget is destroyed prior to the save dialog being closed, ve.init.target is no longer available by the time AddLinkSaveDialog is being torn down, so we probably need another way to check whether null edit has been made.

Update: We don't need another way to check for null edit. On mobile, postEditMobile is fired so we don't need to check if a null edit was made to show the post-edit dialog. If the same check in AddLinkSaveDialogMixin were to be applied on mobile, the post-edit dialog would be shown too early (right after edit is saved instead of after the article reloads).

In short, this console warning didn't have any impact on functionality (I'll submit a patch so skip this check for mobile). When there are no acceptances, the post-edit dialog is shown right after saving on desktop and upon reload on mobile.

Change 702775 had a related patch set uploaded (by MewOphaswongse; author: MewOphaswongse):

[mediawiki/extensions/GrowthExperiments@master] Add a link: only check ve.init.target.madeNullEdit

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

Change 702775 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add a link: only check ve.init.target.madeNullEdit on desktop

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