             self.newWindowHandler.removeAllForUIElement(axElement)
             throw error
         }
+        initializingWindows.append((axElement, promise))
+        return promise
     }
 
     func equalTo(_ rhs: ApplicationDelegate) -> Bool {

        }
    }

    /// Initializes an OSXWindowDelegate for the given axElement and adds it to `windows`, then
    /// calls newWindowHandler handlers for that window, if any. If the window has already been
    /// added, does nothing, and the returned promise resolves to nil.

        guard let systemScreens = stateDelegate?.systemScreens else {
            return .value(nil)
        }
        // Defer to the existing promise if the window is being initialized.
        if let entry = initializingWindows.first(where: { $0.0 == axElement }) {
            return entry.1.map({ _ in nil })
        }
        // Early return if the element already exists.
        if self.windows.contains(where: { $0.axElement == axElement }) {
            return .value(nil)
        }
        let promise = WinDelegate.initialize(
            appDelegate: self, notifier: notifier, axElement: axElement, observer: observer,
            systemScreens: systemScreens
        ).map { windowDelegate in
            self.initializingWindows.removeAll(where: { $0.0 == axElement })

            // This check needs to happen (again) here, because it's possible
            // (though rare) to call this method from two different places
            // (fetchWindows and onWindowCreated) before initialization of
