https://bugzilla.wikimedia.org/show_bug.cgi?id=69918

            Bug ID: 69918
           Summary: OOjs UI: Trying to close a window before it's ready
                    causes a JS error
           Product: OOjs UI
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: General
          Assignee: jforrester+veteambztick...@wikimedia.org
          Reporter: roan.katt...@gmail.com
                CC: jforres...@wikimedia.org
       Web browser: ---
   Mobile Platform: ---

An easy way to reproduce this is to add this.manager.closeWindow( this ); to
the setup process (or ready process, probably) of any window.

closeWindow caches the value of this.opened, and it later assumes that this
value will be non-null (it calls .resolve() on it), but this.opened is
initialized by openWindow only when the window is ready, while currentWindow is
set earlier. So it's possible for closeWindow to go into its "there is
something to close" code path (because currentWindow is set) while this.opened
is still null, and then explore later while trying to call opened.resolve().

Before you tell me that having a window that closes itself from its own
setup/ready is stupid: yes, it is, but 1) something else might try to close it
at exactly the right moment, and 2) self-closing from setup/ready actually
happens in IE right now (that's what https://gerrit.wikimedia.org/r/155181
fixes) because setup/ready moves the focus which causes the context to close
the inspector.

I don't know exactly how best to fix this. Maybe manager.opened should be
initialized earlier, at the same time as currentWindow? We only expose it later
when we resolve opening, but we could create it early so we can resolve it
early.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to