Page MenuHomePhabricator

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


As a follow-up for

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 (
    at process ( 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.Target.destroy --- after this is set to null
  • OO.ui.WindowManager.clearWindows --- at this point, getTeardownProcess for AddLinkSaveDialog is called

Since the ArticleTarget is destroyed prior to the save dialog being closed, 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

Change 702775 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add a link: only check on desktop